Hi.
I am trying to do some stochastic simulation and first of all I want to be sure that I understand the process. So, I would like to replicate the smoothed variable using the simult_ command.
Based on [Simulate a model using smoothed shocks] and [Choosing initial values for simult_], I ran the below code:
y0=[];
SmoothedVars=[];
for endo_iter=1:M_.endo_nbr
field=string(deblank(M_.endo_names(endo_iter,:)));
var=getfield(oo_.SmoothedVariables,field);
SmoothedVars=[SmoothedVars;var’];
y0 = [y0; var(1)];
end;%Update decision rules
[oo_.dr,info,M_,options_] = resol(0,M_,options_,oo_);%Get shocks
ex_=[];
for shock_iter=1:M_.exo_nbr
field=string(deblank(M_.exo_names(shock_iter,:)));
ex_=[ex_ getfield(oo_.SmoothedShocks,field)];
end
ex_= ex_(2:end,:);% Simulation
y_=simult_(M_,options_,y0,oo_.dr,ex_,iorder);
The results are close to the smoothed variables but not the same. Some more questions:
- I do not understand what is happening in “updating decision rules”. Actually, it seems they are already updated in my case.
- In the links above there are some references to oo_.SmoothedShocks.Mean, oo_.SmoothedVariables.Median and oo_.SmoothedVariables.Mean, but I have found only oo_.SmoothedShocks and oo_.SmoothedVariables. Is it a problem or just a change in Dynare?
Would you help me, please?
Btw, happy new year!
Files.zip (191.3 KB)