Dear Dynare users
I want to load the posterior means of the estimated parameters in OSR procedure. To this end, I proceed as follows:
jpfeifer wrote:After estimation, Dynare saves the results in the results file, where it writes the posterior mean to M_. You can easily load this. Make sure to rename your mod-file in order to not overwrite your estimation results. Then, inside of this mod-file use
- Code: Select all
x=load('mymodel_results.mat');
M_.params=x.M_.params;
stoch_simul;
where the command stoch_simul is now replaced by osr.
When estimating the model, my mod file is labelled as model1.mod, while in the osr procedure I rename it to model2.mod. The results matrix after the estimation is model1_results.mat. After the OSR procedure, I get the following error:
Undefined function 'model1_set_auxiliary_variables' for input arguments of type
'double'.
Error in evaluate_steady_state (line 51)
ys_init = h_set_auxiliary_variables(ys_init,exo_ss,M.params);
Error in resol (line 104)
[dr.ys,M.params,info] = evaluate_steady_state(oo.steady_state,M,options,oo,0);
Error in osr_obj (line 48)
[dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
Error in osr1 (line 71)
[loss,vx,info,exit_flag]=osr_obj(t0,i_params,inv_order_var(i_var),weights(i_var,i_var));
Error in osr (line 40)
osr1(i_params,i_var,W);
Error in SimpleRule (line 966)
osr(var_list_,osr_params_,obj_var_,optim_weights_);
Error in dynare (line 180)
evalin('base',fname) ;
Does anyone know what's going wrong?