Displaying and plotting exogenous variables

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.

Displaying and plotting exogenous variables

Postby sjames » Wed Feb 06, 2013 3:44 am

Hi I have a very simple question. I am new to Dynare and replicating the example given in practicing Dynare (Barillas et. al) showing the impact of an increase in government spending (Chapter 11 RMT). I basically tried to run the code that was given in Sargent's website and could not get it to run. I have finally managed to get it to work but cannot dislay or extract the exogenous variable g. The example keeps referring to g as ex_(:,1), but Dynare does not allow me to display it. The code is given below,
Could you please help me with displaying the exogenous shock g. I tried rplot ex_(:,4) as it is the fourth exogenous variable.

Thanks

// This program replicates figure 11.3.1 from chapter 11 of RMT2 by Ljungqvist and Sargent.
var c k;
varexo taui tauc tauk g;
parameters bet gam del alpha A;
bet=.95;
gam=2;
del=.2;
alpha=.33;
A=1;

model;
k=A*k(-1)^alpha+(1-del)*k(-1)-c-g;
c^(-gam)= bet*(c(+1)^(-gam))*((1+tauc(-1))/(1+tauc))*((1-taui)*(1-del)/(1-taui(-1))+
((1-tauk)/(1-taui(-1)))*alpha*A*k(-1)^(alpha-1));
end;

initval;
k=1.5;
c=0.6;
g = 0.2;
tauc = 0;
taui = 0;
tauk = 0;
end;
steady;

endval;
k=1.5;
c=0.4;
g =.4;
tauc =0;
taui =0;
tauk =0;
end;
steady;

shocks;
var g;
periods 1:9;
values 0.2;
end;

simul(periods=100);

co=ys0_(var_index('c'));
ko = ys0_(var_index('k'));
go = ex_(1,1);

rbig0=1/bet;
rbig=y_(var_index('c'),2:101).^(-gam)./(bet*y_(var_index('c'),3:102).^(-gam));
rq0=alpha*A*ko^(alpha-1);
rq=alpha*A*y_(var_index('k'),1:100).^(alpha-1);
wq0=A*ko^alpha-ko*alpha*A*ko^(alpha-1);
wq=A*y_(var_index('k'),1:100).^alpha-y_(var_index('k'),1:100).*alpha*A.*y_(var_index('k'),1:100).^(alpha-1);
sq0=(1-ex_(1,4))*A*alpha*ko^(alpha-1)+(1-del);
sq=(1-ex_(1:100,4)')*A*alpha.*y_(var_index('k'),1:100).^(alpha-1)+(1-del);

rplot c;
rplot plot ex_(:,4) ;
sjames
 
Posts: 2
Joined: Wed Feb 06, 2013 3:25 am

Re: Displaying and plotting exogenous variables

Postby SébastienVillemot » Fri Mar 08, 2013 10:56 am

The “ex_” variable does not exist in Dynare 4. Your example is clearly outdated, and corresponds to an old version of Dynare. Please refer to the documentation of Dynare 4 for achieving this. Essentially, in Dynare 4, the steady state is in “oo_.steady_state”, the path of endogenous variables is in “oo_.endo_simul”, and the path of exogenous variables in “oo_.exo_simul”.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 7 guests