Page 1 of 1

Plotting Policy Functions

PostPosted: Sun Oct 13, 2013 12:46 pm
by nbt
Hi,

Im working on the following simple optimal growth model:
Image
with the first-order conditions:
Image
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
Image
and for my 1st order approx the policy function looks like
Image

Im very thankful for any help!
Best regards,
nbt

Re: Plotting Policy Functions

PostPosted: Mon Oct 14, 2013 9:48 am
by jpfeifer
Look at
STEADY-STATE RESULTS:

y 0.576369
invest 0.1883
k 0.1883
c 0.388069
z 0

You are plotting the policy function in an area where the approximation is poor, e.g. 100 times the steady state value of capital.
for first order, the policy function is linear and upward sloping. For second order, around the steady state, it is still upward sloping, but also concave. For k -> Infinity, the concavity starts to dominate.

Re: Plotting Policy Functions

PostPosted: Mon Oct 14, 2013 2:02 pm
by nbt
Hi,
thanks very much, worked out well now!