Page 1 of 1

Metropolis Hasting simulation

PostPosted: Fri Sep 18, 2009 12:28 pm
by rockyyao
Dear all,
I have a problem when using the Metropolis Hasting algorithm. I first estimate a DSGE model and then simulate it 150000 times in 2 blocks. When I want to simulate another 150000 draws by using following command " estimation(datafile=data_us83, mh_replic=150000, mode_file=NKPC16_Bays8_mode,load_mh_file, mh_nblocks=2, mode_compute=0, mh_jscale=0.25);"

I got the following error massage:

MH: I'm loading past metropolis-hastings simulations...
MH: ... It's done. I've loaded 150000 simulations.

??? Error using ==> load
Unable to read file ./NKPC16_Bays8/metropolis/NKPC16_Bays8_mh25_blck1.mat: No
such file or directory.

Error in ==> random_walk_metropolis_hastings at 60
load(['./' MhDirectoryName '/' ModelName '_mh' int2str(NewFile(b)) ...

Error in ==> dynare_estimation_1 at 940
feval(options_.posterior_sampling_method,'DsgeLikelihood',options_.proposal_distribution,xparam1,invhess,bounds,gend,data);

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

Error in ==> NKPC16_Bays8 at 270
dynare_estimation(var_list_);

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

I checked the fold 'metropolis', where exist only 24 mh files from the previous simulation. Why M-H asks for the 25th?

Could anyone help me to resolve this problem? Thank you in advance

Fang

Re: Metropolis Hasting simulation

PostPosted: Tue Sep 22, 2009 1:18 pm
by StephaneAdjemian
Hi Fang,

What is your Dynare version ? Can you post the mh_history.mat file generated on the first run (you will find the file under the metropolis subfolder)?

Best,
Stéphane.

Re: Metropolis Hasting simulation

PostPosted: Tue Sep 22, 2009 4:11 pm
by dal
I have exactly the same problem. My version of dynare is 4.0.3
I am trying to solve the problem by playing with the 'records' structure (making dynare believe that there is one file less), but this originates another problem:

MCMC Diagnostics: Univariate convergence diagnostic, Brooks and Gelman (1998):
Parameter 1... ??? Subscripted assignment dimension mismatch.

Error in ==> McMCDiagnostics at 105
tmp(:,2) = kron(transpose(1:nblck),ones(NumberOfDraws,1));

Error in ==> dynare_estimation_1 at 944
McMCDiagnostics(options_, estim_params_, M_);

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

Error in ==> usmodel_specA00_robustness_mode1 at 488
dynare_estimation(var_list_);

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