how to write good shock code in dynare

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.

how to write good shock code in dynare

Postby Bernie » Tue Jul 11, 2006 12:16 pm

Dear all,
If my model has three shocks, I writed the code below

shocks;
var epif; stderr 0.007;
var etheta; stderr 0.007;
var eif; stderr 0.007;
end;

stoch_simul(dr_algo=1,drop=200,order=1);

and I don't know why DYNARE show the "bad shock" result.

How can I write code to show "good shock" result?
Bernie
 
Posts: 8
Joined: Tue Jul 11, 2006 12:08 pm

Postby MichelJuillard » Tue Jul 11, 2006 1:46 pm

Dear Bernie,

can you show the whole example (the whole *.mod file) that triggers the "bad shock" message?

Thanks

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby Bernie » Tue Jul 11, 2006 2:59 pm

// example of solving Hansen(1985) model
var y, c, k, a, n, i;
varexo e;

parameters beta, rho, alpha, delta, psi, PSI,sc,si;

alpha = 0.36;
rho = 0.95;
beta = 0.99;
delta = 0.025;
psi = 0;
PSI = 2.5;
sc=0.2564;
si=0.7436;

model(linear);
y=(1+psi)*n+c;
y=a+alpha*k(-1)+(1-alpha)*n;
y=sc*c+si*i;
k=delta*i+(1-delta)*k(-1);
c-c(+1)+(1-beta*(1-delta))*(y(+1)-k);
a=rho*a(-1)+e;
end;


steady;
initval;
y=0;
c=0;
i=0;
k=0;
a=0;
n=0;
e=0;
end;


shocks;
var e; stderr 0.007;
end;

stoch_simul(dr_algo=1,drop=200,order=1);

I want the variable "a" upward.

but the result show the variable "a" downward.

thanks Professor
Bernie
 
Posts: 8
Joined: Tue Jul 11, 2006 12:08 pm

Postby Bernie » Wed Jul 12, 2006 11:34 am

Dear Professor
sorry!
my English is very poor
I dont know what you mean
so I write out hansen model's code

please help me to solve this question

thank you
Bernie
 
Posts: 8
Joined: Tue Jul 11, 2006 12:08 pm

Postby MichelJuillard » Wed Jul 12, 2006 12:14 pm

Dear Bernie,

I believe that you are refering to the Impulse Response Function of variable 'a' following a one standard deviation shock on 'e'

This curve is downward sloping and it is what we expect.

From its specification, variable 'a' has zero mean. What the IRF curve shows is that after an initial shock of 0.007 (stderr e), variable 'a' goes back to its mean of zero.

This is to be expected in a stationary model. If you expect to see a growing curve for 'a', you are thinking about a growth model, but it isn't the model that you have written in Dynare.

Because growth models are nonstationary, it is easier to work with the stationarized version of such models. If you know the trend, you can always add it after the simulation of the stationary components of the variables.

Hope it helps

Michel
Last edited by MichelJuillard on Wed Jul 12, 2006 1:06 pm, edited 1 time in total.
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby Bernie » Wed Jul 12, 2006 12:56 pm

Dear Professor

I understand!

thanks a lot
Bernie
 
Posts: 8
Joined: Tue Jul 11, 2006 12:08 pm

Postby Bernie » Wed Jul 12, 2006 4:47 pm

Dear Professor
I have another question.

Q:these picture result
the shock impact this model then "a" goes up and downward sloping mean that "a" return to original position.

Is this right?

thanks
Bernie
 
Posts: 8
Joined: Tue Jul 11, 2006 12:08 pm

Postby MichelJuillard » Wed Jul 12, 2006 4:55 pm

Yes, it is. In a stationary model. The variables always go back to equilibrium after a temporary shock.

Regards

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby Bernie » Wed Jul 12, 2006 5:19 pm

Dear Professor

Q1:
If I want to see permanent shock result, how can I write the code?

Q2:
If my another model has three shock, I write down the code below
shocks;
var epif; stderr 0.007;
var etheta; stderr 0.007;
var eif; stderr 0.007;
end;

stoch_simul(dr_algo=1,drop=200,order=1);

the numerical result mean all shock together affect my model.
Is it right?

thank a lot
Bernie
 
Posts: 8
Joined: Tue Jul 11, 2006 12:08 pm

Postby MichelJuillard » Wed Jul 12, 2006 7:43 pm

Q1: to study a permanent shock
a) use a deterministic model with initval and endval (see the manual)
b) un permanent shock in stochastic model means that the exogenous process in integrated of order 1 (nonstationary). Write the stationarized version of the model, perform the simulation, then add back the nonstationary components to the results. If you are not familiar with the handling of nonstationary models, you probably need to ask for help at your local university.

Kind regards

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby Bernie » Thu Jul 13, 2006 11:12 am

Professor

thanks a lot
Bernie
 
Posts: 8
Joined: Tue Jul 11, 2006 12:08 pm


Return to Dynare help

Who is online

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