new DSGE instruction

Discussion of State Space and Dynamic Stochastic General Equilibrium Models
Maximiliano Dvorkin
Posts: 1
Joined: Sat Sep 29, 2007 6:02 am

new DSGE instruction

Unread post by Maximiliano Dvorkin »

Hi,

I am trying the new DSGE instruction of version 7. I coded up a basic RBC model. When I use the option "expand=linear" the solution works well and matches the one I get by doing the linearization by hand and then solving the model by Sims method.
However, when I change the option to "expand=loglinear" the instruction does not seem to work well and the results do not match the ones I get by doing the loglinearization by hand and then solving.

The code is as follows (simple RBC with full depreciation):

Code: Select all

declare series k z c 

 compute alpha = 0.33
 compute rho = 0.95
 compute beta = 0.99

 compute kss = (beta * alpha)^(1/(1-alpha));
 compute css = kss^alpha - kss;

 frml(identity) f1 = (1.0/c) - (beta * alpha * (1.0/c{-1}) * exp(z{-1}) * k^(alpha-1))
 frml(identity) f2 = (c + k) - (exp(z)*k{1}^(alpha))
 frml f3 = z - rho * z{1};
 group rbcmodel f1 f2 f3

 dsge(model=rbcmodel,expand=linear,a=amat,f=fmat,z=zmat,initial=||kss,0,css||,steadystate=steady) k z c

disp fmat
disp amat
disp zmat
disp steady


Am I coding it up right?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Unread post by TomDoan »

expand=loglinear assumes that all the variables can be log-linearized. As you have it coded, your productivity shock is already in log form. If you redo this as

Code: Select all

 frml(identity) f1 = (c{-1}/c) - (beta * alpha * z{-1} * k^(alpha-1)) 
 frml(identity) f2 = (c + k) - (z*k{1}^(alpha)) 
 frml f3 = log(z) - rho * log(z{1}); 
it should work better.
Post Reply