Something strange wrong with RBC_Est! Help me!

When I am trying to replicate the Bayesian estimation with the example of RBC_Est which is done in the User Guide version beta (chapter 5). I did not do any change with the code; the softwares which I use are dynare 4.20 and Matlab 7.1 ;the attachments are the code of RBC_Est.mod and the data. It did very well at first,and it turned out 5 Figures successively ,such as MCMC ****.But when it’s going to turn out the sixth figure(Priors and Posteriors),many errors (below) came out in Matlab ,and the sixth figure failed! Could you tell me why ?

Thank you

Best wishes

ZHAN

dynare RBC_Est

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.2.0).
Starting preprocessing of the model file …
Found 9 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …done
    Preprocessing completed.
    Starting MATLAB/Octave computing.

You did not declare endogenous variables after the estimation command.
This version of Dynare cannot estimate non linearized models!
Set “order” equal to 1.

Warning: File ‘RBC_Est/prior’ not found.

In CheckPath at 42
In set_prior at 245
In dynare_estimation_1 at 104
In dynare_estimation at 62
In RBC_Est at 135
In dynare at 132
Loading 600 observations from simuldataRBC1.m

??? Index exceeds matrix dimensions.

Error in ==> dynare_estimation_1 at 273
rawdata = rawdata(options_.first_obs:options_.first_obs+gend-1,:);

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

Error in ==> RBC_Est at 135
dynare_estimation(var_list_);

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

clear all
dynare RBC_Est

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.2.0).
Starting preprocessing of the model file …
Found 9 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …done
    Preprocessing completed.
    Starting MATLAB/Octave computing.

You did not declare endogenous variables after the estimation command.
This version of Dynare cannot estimate non linearized models!
Set “order” equal to 1.

Loading 1000 observations from simuldataRBC1.m

Initial value of the log posterior (or likelihood): 657.2162
Warning: File ‘RBC_Est_optimal_mh_scale_parameter.mat’ not found.

In dynare_estimation_1 at 406
In dynare_estimation at 62
In RBC_Est at 135
In dynare at 132

==========================================================
Change in the covariance matrix = 10.
Mode improvement = 18.9578
New value of jscale = 0.00061859

Change in the covariance matrix = 0.00066906.
Mode improvement = 1.7971

RESULTS FROM POSTERIOR MAXIMIZATION
parameters
prior mean mode s.d. t-stat prior pstdev

alpha 0.350 0.3330 0.0031 106.8017 beta 0.0200
beta 0.990 0.9899 0.0007 1471.1534 beta 0.0020
delta 0.025 0.0253 0.0012 20.6194 beta 0.0030
psi 1.750 1.7508 0.0031 564.1944 gamm 0.0200
rho 0.950 0.9283 0.0259 35.8712 beta 0.0500
epsilon 10.000 10.0000 0.0007 13525.8748 gamm 0.0030
standard deviation of shocks
prior mean mode s.d. t-stat prior pstdev

e 0.010 0.0103 0.0009 11.1346 invg Inf

Log data density [Laplace approximation] is 637.607465.

Warning: File ‘RBC_Est/Output’ not found.

In CheckPath at 42
In dynare_estimation_1 at 901
In dynare_estimation at 62
In RBC_Est at 135
In dynare at 132
Warning: File ‘RBC_Est/metropolis’ not found.
In CheckPath at 42
In metropolis_hastings_initialization at 46
In random_walk_metropolis_hastings at 58
In dynare_estimation_1 at 1106
In dynare_estimation at 62
In RBC_Est at 135
In dynare at 132
MH: Multiple chains mode.
MH: Searching for initial values…
MH: Initial values found!

MH: Number of mh files : 1 per block.
MH: Total number of generated files : 2.
MH: Total number of iterations : 2000.
MH: average acceptation rate per chain :
0.2834 0.3038

MCMC Diagnostics: Univariate convergence diagnostic, Brooks and Gelman (1998):
Parameter 1… Done!
Parameter 2… Done!
Parameter 3… Done!
Parameter 4… Done!
Parameter 5… Done!
Parameter 6… Done!
Parameter 7… Done!

MH: Total number of Mh draws: 2000.
MH: Total number of generated Mh files: 1.
MH: I’ll use mh-files 1 to 1.
MH: In mh-file number 1 i’ll start at line 900.
MH: Finally I keep 1100 draws.

MH: I’m computing the posterior mean and covariance… Done!

MH: I’m computing the posterior log marginale density (modified harmonic mean)…
MH: Modified harmonic mean estimator, done!

ESTIMATION RESULTS

Log data density is 644.722294.

parameters
prior mean post. mean conf. interval prior pstdev

alpha 0.350 0.3351 0.3226 0.3484 beta 0.0200
beta 0.990 0.9892 0.9862 0.9927 beta 0.0020
delta 0.025 0.0252 0.0213 0.0289 beta 0.0030
psi 1.750 1.7516 1.7119 1.7886 gamm 0.0200
rho 0.950 0.9362 0.8891 0.9824 beta 0.0500
epsilon 10.000 10.0004 9.9966 10.0041 gamm 0.0030

standard deviation of shocks
prior mean post. mean conf. interval prior pstdev

e 0.010 0.0108 0.0095 0.0122 invg Inf

                              !!!!!!!!!!!!!!!!!!!!!Red errors!!!!!!!!!!!!!!!!

**??? Error using ==> f1
Too many output arguments.

Error in ==> PlotPosteriorDistributions at 139
top1 = max(f1);

Error in ==> dynare_estimation_1 at 1123
oo_ = PlotPosteriorDistributions(estim_params_, M_, options_, bayestopt_, oo_);

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

Error in ==> RBC_Est at 135
dynare_estimation(var_list_);

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

RBC_Est.mod (797 Bytes)**
simuldataRBC1.m (15.6 KB)

I cannot reproduce your problem with Dynare 4.2.1.

Could it be that you have a function called “f1” in your working directory, that would conflict with a variable name?