Choosing initial values for simult_

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Re: Choosing initial values for simult_

Postby aaronsun » Sat Mar 07, 2015 9:39 pm

jpfeifer wrote:Please try
Code: Select all
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--')

That works for me. The series are only different where you allow for measurement error.

Note finally that some small differences are expected. The steady state values of your model variables are nonlinear functions of the parameters. Thus, the steady state used is at the mean of the parameters, but you would actually need the mean of the steady states.




Great help. It works perfectly! I really appreciate your help. -- Aaron
aaronsun
 
Posts: 13
Joined: Mon Mar 17, 2014 7:39 pm

Previous

Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests