alex wrote:First, to check that the ordering of the variables was correct, as you suggested I inputed in simult_ a series of shocks set to zero and as initial condition, the steady state values. Simulated variables stayed at their ss values over the simulation, so this confirmed that the ordering was correct.
Then I inputed as initial condition for simult_ the first observations of the series included in oo_.SmoothedVariables, and the sequence of shocks included in oo_.SmoothedShocks. To solve the issue:
- I had to trim the first observation of the sequences of shocks to make sure that the initial conditions would match.
- To compare the series output of simult_ with those in oo_.SmoothedVariables I had to put back the steady-state levels in the oo_.SmoothedVariables series, as apparently these series are log-deviations from their steady-state levels.
Results perfectly match!
Alex
jpfeifer wrote:Are you using 4.4.3? Have you checked whether the variable ordering matches?
jpfeifer wrote:You must be doing something wrong. For observed variables, the simulated smoothed variables must be identical to the observed series. Have compared your simulated series to the Dynare oo_.SmoothedVariables?
jpfeifer wrote:You must be doing something wrong. For observed variables, the simulated smoothed variables must be identical to the observed series. Have compared your simulated series to the Dynare oo_.SmoothedVariables?
clear; close all; clc
dynare jules1.mod
%set shocks
ex_=[];
for shock_iter=1:M_.exo_nbr
ex_=[ex_ oo_.SmoothedShocks.Mean.(deblank(M_.exo_names(shock_iter,:)))];
end
%use shocks only starting at t=2 due to t=1 being initial condition
ex_ = ex_(2:end,:);
%set starting values
y0=[];
for endo_iter=1:M_.endo_nbr
y0 = [y0;
oo_.SmoothedVariables.Mean.(deblank(M_.endo_names(endo_iter,:)))(1)];
end;
%make sure decision rules were updated
[oo_.dr,info,M_,options_] = resol(0,M_,options_,oo_);
dr = oo_.dr;
iorder=1;
y_=simult_(y0,dr,ex_,iorder);
US_data_65Q106Q4HP
figure
plot(data_CC)
hold on
plot(y_(strmatch('data_CC',M_.endo_names,'exact'),:),'r--')
Users browsing this forum: Google [Bot] and 6 guests