Random Walk Metropolis for posterior mean and standard deviation

Hi evreryone,
I am trying to estimate a DSGE model and I would like to generate posterior statisctics of parameters( mean and standard deviation) by using random walk metropolis in Dynare 4.5.7. I have introduced in the code the command bellow but it dosen’t work. estimation(datafile=data_nfbsop_54q307q2, first_obs=1 ,prefilter=0,mode_compute=0,mode_file=cn_fsample_mode,lik_init=2,conf_sig=0.90,bayesian_irf,smoother,mh_nblocks=2,mh_jscale=0.25,mh_drop=0.5,mh_replic=500000);
prior optimize;

I am looking for the code of Dynare to generate posterior statistics of parameters. Thank you

What is the error message?

Why do you have two estimation-commands in the file? And one with lik_init=2 (Harvey/Phillips initialization) and one with diffuse_filter? If you want the second command to work, you should replace diffuse_filter by lik_init=3.

Thank you for your answer,
for the second command l tried to estimate the model and compute IRF function at the same time. Excuse my lack of knowledge in DSGE modeling. I have tried your proposition it allows to solve the error line (121) but the other errors keep staying. Also I did not find the posterior estimation of the parameters in the output and i have alwayse this table called RESULTS FROM POSTERIOR ESTIMATION in the output attached but don’t shows posterior estimation. please find attached the file output+ errors message and the m.files for the new errors
Thank you
output errors message .txt (32.4 KB)
dynare_estimation_init.m (28.6 KB) error 463 cn_amend_7obs.m (19.7 KB)

I am still not sure what you are trying to achieve. The error you are now getting is from you trying to load a mode-file that does not exist, because you renamed your file but did not adjust this filename.
Also, which output exactly are you looking for?

Dear jpfeifer,

Thank you for your help. I am looking for output of posterior estimation of parameters ( posterior mean and posterior stdv) by using Random Walk Metropolis.

You ran the first estimation-command with


so there was no Random Walk Metropolis that ran.