Baysian estimation of Lubik et al JME 2007

Hi,

I am trying to make an estimation procedure for a model similar to this…When I start the estimation the figure with the initial prior keeps coming to the screen until Matlab stops and display the message that the maximum number of interactions was reached…Any idea of what might be happening?

Thanks a lot,

Pedro

??? Maximum recursion limit of 500 reached. Use set(0,‘RecursionLimit’,N)
to change the limit. Be aware that exceeding your available stack space can
crash MATLAB and/or your computer.

Error in ==> double.superiorfloat at 18

Error in ==> teste at 216
dynare_estimation(var_list_);

Also when I the prior plots a repeatedly coming to my screen and I close one of them Matlab stops and shows the following error message:

??? Error using ==> print
Error using ==> graphics\private\restore
Invalid handle object.

Error in ==> plot_priors at 154
eval('print -dpdf ’ M_.fname ‘_Priors’ int2str(nbplt)]);

Error in ==> dynare_estimation_1 at 92
plot_priors

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> teste at 216
dynare_estimation(var_list_);

Error in ==> dynare at 102
evalin(‘base’,fname) ;

Anyone has experience in this kind of stuff? Really I appreciate any comment…Thanks!!

Dear Pedro,

I guess there is a problem with one of the routines defining the prior hyperparameters. Can you please post your mod file (with data) ?

Best, Stéphane.

Hi Stephane,

thank you for your reply. I appreciate any comment.
I attached my .mod file and the.xls file with the data.

Thank you,

Pedro
teste.xls (17.5 KB)
teste1.mod (1.65 KB)

Hi All,

I am posting my .mod file and .xls data. The graph with the priors keep appearing in the screen and when I stop it I get the error message pasted below. Does anyone have a comment?
Thank you very much,

Pedro

Error message:

??? Error using ==> print
Error using ==> graphics\private\restore
Invalid handle object.

Error in ==> plot_priors at 109
eval('print -depsc2 ’ M_.fname ‘_Priors’ int2str(plt) ‘.eps’]);

Error in ==> dynare_estimation_1 at 92
plot_priors

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> teste at 216
dynare_estimation(var_list_);

Error in ==> read_variables at 42
eval(dyn_instr_01);

Error in ==> dynare_estimation_1 at 237
rawdata = read_variables(options_.datafile,options_.varobs,],options_.xls_sheet,options_.xls_range);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> teste at 216
dynare_estimation(var_list_);

Error in ==> read_variables at 42
eval(dyn_instr_01);

Error in ==> dynare_estimation_1 at 237
rawdata = read_variables(options_.datafile,options_.varobs,],options_.xls_sheet,options_.xls_range);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> teste at 216
dynare_estimation(var_list_);

Error in ==> read_variables at 42
eval(dyn_instr_01);

Error in ==> dynare_estimation_1 at 237
rawdata = read_variables(options_.datafile,options_.varobs,],options_.xls_sheet,options_.xls_range);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> teste at 216
dynare_estimation(var_list_);

Error in ==> read_variables at 42
eval(dyn_instr_01);

Error in ==> dynare_estimation_1 at 237
rawdata = read_variables(options_.datafile,options_.varobs,],options_.xls_sheet,options_.xls_range);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> teste at 216
dynare_estimation(var_list_);

Error in ==> read_variables at 42
eval(dyn_instr_01);

Error in ==> dynare_estimation_1 at 237
rawdata = read_variables(options_.datafile,options_.varobs,],options_.xls_sheet,options_.xls_range);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> teste at 216
dynare_estimation(var_list_);

Error in ==> dynare at 102
evalin(‘base’,fname) ;
teste1.mod (1.65 KB)
teste.xls (17.5 KB)

Hi Pedro,

You have several problems here.

First, the problem with the priors seems to be related to your matlab installation. There is a bug when dynare tries to save the plots in eps or pdf formats. If you cannot fix this (you may find some tips on a matlab dedicated forum), you can comment out the lines 65, 67, 108, 110, 151 and 153 (note that I am refering to the line numbers of the snapshot version, these numbers may be wrong with your dynare version).

Second, there is a problem with the declaration of the priors on the size of the structural shocks. You have to replace

sigmar, inv_gamma_pdf, 0.5, 4;
sigmaq, inv_gamma_pdf, 1.5, 4;
sigmaz, inv_gamma_pdf, 1, 4;
sigmayw, inv_gamma_pdf, 1.5, 4;
sigmapw, inv_gamma_pdf, 0.55, 4;

by

stderr ur, inv_gamma_pdf, 0.5, 4;
stderr uq, inv_gamma_pdf, 1.5, 4;
stderr uz, inv_gamma_pdf, 1, 4;
stderr uyw, inv_gamma_pdf, 1.5, 4;
stderr upw, inv_gamma_pdf, 0.55, 4;

Best,
Stéphane.

[quote=“pedroac81”]Hi Stephane,

thank you for your reply. I appreciate any comment.
I attached my .mod file and the.xls file with the data.

Thank you,

Pedro[/quote]

Hi there,

unfortunately I have to pick up the problem again.

My settings are the following:
Matlab 2008, Dynare 4.2.1 trying to estimate Smets Wouters 2003 Paper on the EU,

Matlab wont stop to plot priors and only stops when I close one of the figures, then the following error message appears:

??? Error using ==> print at 310
Error using ==> get
Invalid handle object.

and much more which I ommit here.

Do you guys have a clue whats going on here?

You have the data and mod file attached.

Best wishes and many thanks for your comments.

Philipp
sw03est.xls (34 KB)
sw03est.mod (4.96 KB)

You named your data-file as the mod-file. Dynare then creates an m-file with the same name. When Dynare tries to load the data, it runs the m-file again and enters an infinite loop. Rename the data-file.

Dear jpfeifer,

thanks for your quick response. What a silly mistake…

best, Philipp