Bayesian estimation _ mode_computation

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Re: Bayesian estimation _ mode_computation

Postby jpfeifer » Mon Nov 28, 2016 2:43 pm

What exactly is your problem? Looking at the prior posterior plots and the trace plots, the estimation results look quite good.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Bayesian estimation _ mode_computation

Postby KKLS » Mon Nov 28, 2016 2:54 pm

Looking at the graphs which I am citing below :
0 posterior1.jpg Posterior for ''eps_IS''
0 posterior2.jpg Posterior for '' phiX '' zzeta, gammP, thetP, thetY,
0 posterior3.jpg Posterior for ''rhoBU''


the green line does not intersect at the peak of the posterior distribution.

Isn't it supposed to be that way ? that is the vertical (green ) line cut the posterior )black) at the peak ??
Alternatively how would I interpret that the posterior mode (greeen line) is not at the peak of the distribution ???

thanks a lot for your time Prof. Pfeifer !
KKLS
 
Posts: 38
Joined: Sat May 21, 2016 11:24 am

Re: Bayesian estimation _ mode_computation

Postby jpfeifer » Tue Nov 29, 2016 10:25 am

This can sometimes happen, but given the rather small differences this is not a reason to worry in your case (the distributions are made using a kernel density estimate and the peak can be somewhat off in that case). Usually when there is a serious problem, the green line is far away and the trace plots show serious drift. None of this is the case here.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Bayesian estimation _ mode_computation

Postby KKLS » Tue Nov 29, 2016 1:17 pm

Many thanks for the comments again Prof.

I think i might have the situation similar to what you are mentioning: that is a drift in the trace plots.

by jpfeifer » Tue Nov 29, 2016 10:25 am
This can sometimes happen, but given the rather small differences this is not a reason to worry in your case (the distributions are made using a kernel density estimate and the peak can be somewhat off in that case). Usually when there is a serious problem , the green line is far away and the trace plots show serious drift. None of this is the case here.


I have simultaneously estimated the same model with a shorter sample of the same observables.
It seems there is a problem with the traceplots (i.e parameter ''thetP'', and ''epsIS'' )

Is there much I can do about it ?
probably raise the replications even further (currently 550) ?
Attachments
diag_SUBsample_550.zip
SUBsample _estimation TRACE_plot drifts
(1.11 MiB) Downloaded 62 times
KKLS
 
Posts: 38
Joined: Sat May 21, 2016 11:24 am

Re: Bayesian estimation _ mode_computation

Postby jpfeifer » Tue Nov 29, 2016 8:53 pm

Not exactly. What you see in those two graphs is an example of bimodality, where the MCMC correctly explores both regions. You still might want to use a longer chain to properly sample from both modes. But there is nothing here to suggest that the chain has not yet converged to its ergodic distribution.
Have you looked at a trace_plot of the posterior density?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Bayesian estimation _ mode_computation

Postby KKLS » Wed Nov 30, 2016 10:16 am

by jpfeifer » Tue Nov 29, 2016 8:53 pm

Not exactly. What you see in those two graphs is an example of bimodality, where the MCMC correctly explores both regions. You still might want to use a longer chain to properly sample from both modes. But there is nothing here to suggest that the chain has not yet converged to its ergodic distribution.
Have you looked at a trace_plot of the posterior density?


Yes I have. and I have included them in the zip folder that i attached.

There is small drift in the middle of the replications horizon for few of the parameters.
I will keep raising it though. Thanks.

One final question, : in the estimation command can i put all the options that go with stoch_simul (i.e order=1, hpfilter=1600, irf=40 ) ???

Many many thanks gain for your time Prof. Pfeifer.
KKLS
 
Posts: 38
Joined: Sat May 21, 2016 11:24 am

Re: Bayesian estimation _ mode_computation

Postby jpfeifer » Wed Nov 30, 2016 10:36 am

No, you included the trace_plot for the parameters, but not the one for the posterior density itself, i.e. the result from
Code: Select all
trace_plot(options_,M_,estim_params_,'PosteriorDensity',1)


No, you cannot put all the same options there. The manual tells you what is allowed. For example, the
Code: Select all
hp_filter
does not work with estimation
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Bayesian estimation _ mode_computation

Postby KKLS » Sat Dec 03, 2016 6:08 pm

Hi Prof. Pfeifer and all ,
I tried several times to follow up on Prof. Pfeifer advise (see quote below) regarding the trace plot :

by jpfeifer » Wed Nov 30, 2016 10:36 am
No, you included the trace_plot for the parameters, but not the one for the posterior density itself, i.e. the result from
Code: Select all
trace_plot(options_,M_,estim_params_,'PosteriorDensity',1)


so after the estimation command i set these commands :

trace_plot(options_,M_,estim_params_,'PosteriorDensity',1);
trace_plot(options_,M_,estim_params_,'PosteriorDensity',2);


... but I was not able to get the trace plot . I am getting an error as below.

Estimation::mcmc: Posterior (dsge) IRFs...
Estimation::mcmc: Posterior IRFs, done!
Not enough input arguments.

Error in trace_plot (line 39)
column = name2index(options_, M_, estim_params_, type, name1);

Error in BggGKlinear (line 1250)
trace_plot(options_,M_,estim_params_,'PosteriorDensity',1);

Error in dynare (line 180)
evalin('base',fname) ;


Ps.
I tried only for block one,i.e:
trace_plot(options_,M_,estim_params_,'PosteriorDensity',1);


... and I tried writing the command above after I had asked for trace plot of individual estimated parameters (and shocks)

trace_plot(options_,M_,estim_params_,'StructuralShock',2,'epsA');
...
all shocks and parameters
...

trace_plot(options_,M_,estim_params_,'PosteriorDensity',1);


I get the same error ( Dynare produces the trace plot for individual parameters but not the one for the posterior density) . Did I miss something pls ?
KKLS
 
Posts: 38
Joined: Sat May 21, 2016 11:24 am

Re: Bayesian estimation _ mode_computation

Postby jpfeifer » Sun Dec 04, 2016 8:55 am

That command only works in the unstable version of Dynare, to be released as Dynare 4.5.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Bayesian estimation _ mode_computation

Postby KKLS » Thu Dec 15, 2016 6:25 pm

Hi to Prof. Pfeifer and all,

I have read the previous posts regarding the model comparisons via likelihoods ratio (and odds ratio) .

From one post of Prof. Pfeifer it seems that to compare to models estimated on different data sets , the odds ratio comparisons are not vaild (see the quote below) .

My question that follows is:
if I got two models A and B where one is a nested version of the other, and where

- for the smaller model I use a data series X and Y (plus some other data which are the same in the two models)
- for the bigger model I use a data series Z = X+Y (that is Z is the sum of X and Y).

The reason I do not use the extra data series on the smaller model is that the smaller model provides a variable which is counterpart to Z only (but no info on its components X or Y).

1. Can I still use the odds ratio comparison based on marginal densities (Laplace and ModifiedHarmonicMean) ?
2. Is there an alternative way of comparing these models ?

Many thanks again Profesor

Ps.
Re: Model Comparison Bayesian Estimation (again)
Postby jpfeifer » Fri Apr 04, 2014 9:04 am
Basically all your answers are in Koop's 2003 textbook "Bayesian Econometrics" on pages 4-5.
1. For Bayesian model comparison models do not need to be nested and there is a natural degrees of freedom correction. [b][color=#FF0000]Hence, as long as you use the same data having different parameters does not matter at all.
KKLS
 
Posts: 38
Joined: Sat May 21, 2016 11:24 am

Re: Bayesian estimation _ mode_computation

Postby jpfeifer » Fri Dec 16, 2016 7:54 am

The odds ratio is based on the marginal data density. That is the "likelihood" of observing the data given the model. A meaningful comparison involves keeping the data fixed and varying the model. Simultaneously changing the model and the data does not allow for a sensible comparison. Thus, the answer is no. Having Z being the sum of X and Y does not help, because the model only needs to account for this sum, not for the series individually.
To get some intuition, think about the models having k parameters and there being T observations. Then the bigger model with X and Y observed will have 2*T-k degrees of freedom while the smaller on with Z will only have T-k.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Bayesian estimation _ mode_computation

Postby KKLS » Fri Dec 16, 2016 4:28 pm

Many thanks for confirming it Prof. Pfeifer,

A technical question: When I try to find the mode (given that I already have a ''FILENAME_mode.mat'')

I get a warning like this:

The steady state file internally changed the values of the following estimated parameters:


Is there a warning I should care about (indeed when I get this warning, I get a ''non-positive definite Hessian matrix'' problem .
Where would I look to fix that problem please ?

Ps. I googled a bit and I found a script on your github (initial_estimation_checks.m ) but it is not clear to me what the problem is in this case.
KKLS
 
Posts: 38
Joined: Sat May 21, 2016 11:24 am

Previous

Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 5 guests