Skip to content

Commit

Permalink
added lambda_posterior draws in panel 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ebenetce committed Nov 9, 2023
1 parent a3ca553 commit 95669b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tbx/bear/+bear/panel4gibbs.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@
% if there is no post burn selection
if pick==0
% record the draw
beta_mean(:,count-Bu)=b;
sigma_mean(:,count-Bu)=bear.vec(mean(sigma,3));
lambda_posterior(count-Bu)=lambda1;
% loop over units
for ii=1:N
beta_gibbs(:,count-Bu,ii)=beta(:,ii);
Expand Down
2 changes: 1 addition & 1 deletion tbx/bear/BEARmain.m
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ function BEARmain(opts)
% obtain prior elements
[omegab]=bear.panel4prior(N,n,m,p,T,k,data_endo,q,opts.lambda3,opts.lambda2,opts.lambda4);
% run the Gibbs sampler
[beta_gibbs,sigma_gibbs]=bear.panel4gibbs(N,n,h,T,k,q,Yi,Xi,opts.s0,omegab,opts.v0,opts.It,opts.Bu,opts.pick,opts.pickf);
[beta_gibbs,sigma_gibbs,beta_mean,sigma_mean,lambda_posterior]=bear.panel4gibbs(N,n,h,T,k,q,Yi,Xi,opts.s0,omegab,opts.v0,opts.It,opts.Bu,opts.pick,opts.pickf);
% compute posterior estimates
[beta_median, beta_std, beta_lbound, beta_ubound, sigma_median]=bear.panel4estimates(N,n,q,beta_gibbs,sigma_gibbs,cband,[],[]); % beta_mean,sigma_mean
% plot a first set of results
Expand Down

0 comments on commit 95669b7

Please sign in to comment.