Plotting Policy Functions
Posted: Sun Oct 13, 2013 12:46 pm
Hi,
Im working on the following simple optimal growth model:
with the first-order conditions:
The Dynare code is:
For plotting the policy function I used the m-file by jpfeifer ยป Sat Mar 16, 2013 (attached)
My goal is to show the differences that occur between the policy functions using first and second order approximation due to certainty equivalence.
Yet I got really strange results. For the 2nd order approximation my policy function looks like
and for my 1st order approx the policy function looks like
Im very thankful for any help!
Best regards,
nbt
Im working on the following simple optimal growth model:
with the first-order conditions:
The Dynare code is:
- Code: Select all
%
%%%PREAMBLE%%%
%
var y invest k c z;
predetermined_variables k;
varexo eps;
parameters cbeta calpha crho ceta;
cbeta = .99;
calpha = .33;
crho = 0.9;
csigma = 0.035;
%
%%%MODELBLOCK%%%
%
model;
1/c = cbeta * 1/c(+1) * calpha * exp(z(+1)) * k(+1)^(calpha-1);
k(+1) = exp(z) * k^calpha - c;
z = crho*z(-1) + eps;
y = exp(z) * k^calpha;
invest = y - c;
end;
%
%%%INITIAL VALUE BLOCK%%%
%
initval;
k = 0.2;
c = 0.4;
z = 0;
end;
steady;
%
%%%SHOCKS%%%
%
shocks;
var eps = csigma^2;
end;
stoch_simul(periods = 2000,order=2, irf=40);
state_range=0:0.1:10;
state_name='k';
plot_var_name='c';
plot_policy_fun(state_name,state_range,plot_var_name);
For plotting the policy function I used the m-file by jpfeifer ยป Sat Mar 16, 2013 (attached)
My goal is to show the differences that occur between the policy functions using first and second order approximation due to certainty equivalence.
Yet I got really strange results. For the 2nd order approximation my policy function looks like
and for my 1st order approx the policy function looks like
Im very thankful for any help!
Best regards,
nbt