Metropolis Hasting simulation

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.

Metropolis Hasting simulation

Postby rockyyao » Fri Sep 18, 2009 12:28 pm

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
rockyyao
 
Posts: 18
Joined: Mon Mar 10, 2008 4:37 pm

Re: Metropolis Hasting simulation

Postby StephaneAdjemian » Tue Sep 22, 2009 1:18 pm

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.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: Metropolis Hasting simulation

Postby dal » Tue Sep 22, 2009 4:11 pm

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) ;
dal
 
Posts: 4
Joined: Tue Mar 03, 2009 4:16 pm


Return to Dynare help

Who is online

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