RBC_est.mod

Hello,
I was trying to run RBC_est.mod, but I can find the “simuldataRBC”, so I search in dynare forum and find the link File simuldataRBC.
I download it , but i can run it againt, the error :
You did not declare endogenous variables after the estimation/calib_smoother command.
??? Undefined function or method ‘gaminv’ for input arguments of type ‘double’.

Error in ==> draw_prior_density at 72
infbound = 1/sqrt(gaminv(1-10*truncprior, p7(indx)/2,
2/p6(indx)))+p3(indx);

Error in ==> plot_priors at 55
[x,f,abscissa,dens,binf,bsup] = draw_prior_density(i,bayestopt_);

Error in ==> dynare_estimation_init at 125
plot_priors(bayestopt_,M_,estim_params_,options_)

Error in ==> dynare_estimation_1 at 59
[dataset_,xparam1, M_, options_, oo_, estim_params_,bayestopt_] =
dynare_estimation_init(var_list_, dname, ], M_, options_, oo_, estim_params_,
bayestopt_);

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> rbc_est at 142
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin(‘base’,fname) ;
I was attached 2 file, can you help me ? I am sorry if it has any misspelling
simuldataRBC.m (141 KB)
RBC_Est.mod (796 Bytes)

Which version of Dynare are you using? It works on my machine with Dynare 4.3.2. Moreover, there could be an issue with your paths. The function gaminv should be contained in the \matlab\missing\stats subfolder of your Dynare installation.

I encountered exactly the same problem. My dynare is 4.4.3, and the gaminv function is definitely there. What could have gone wrong?

Is there a particular reason you are using Dynare 4.4.3? And did you make sure you use a compatible Matlab or Octave version?

I’m using Matlab R2022b; seems like the version of dynare is just by default.

If I remember correctly, that old Dynare version is not compatible with recent Matlab versions due to changes in the Matlab function interfaces. Why don’t you upgrade to a newer Dynare version?

I uninstall 4.4.3, and install 6.0 instead, and add addpath C:\dynare\6.0\matlab to path, after I call dynare RBC_est.mod, it returns the following error:

The class ‘dates’ is used in its own class definition as a base class, property value, or attribute value. This is not allowed.
Error in global_initialization (line 93)
oo_.initval_series = dseries();
Error in sec5_RBC_Bayesian.driver (line 20)
global_initialization;
Error in dynare (line 310)
evalin(‘base’,[fname ‘.driver’]);

That means that there are still remnants of a previous Dynare version added to Matlab‘s path.

I remove all the other paths but just the 6.0, it still says the same error…

Did you use restoredefaultpath in Matlab?