Page 1 of 1

Input exogenous variables

PostPosted: Thu Jun 15, 2006 10:05 am
by hk
Dear all,

I tried to input deterministic shocks using the command "shocks" by changing the "example1.mod". This is following code. However, this code didn't work. Please tell me that the way of inputing determistic shocks (exogenous variables) in stochastic simulation.

Best Wishes,

*************************************************************// example 1 from Collard's guide to Dynare
var y, c, k, a, h, b;
varexo u;
varexo_det e;

parameters beta, rho, beta, alpha, delta, theta, psi, tau;

alpha = 0.36;
rho = 0.95;
tau = 0.025;
beta = 0.99;
delta = 0.025;
psi = 0;
theta = 2.95;

phi = 0.1;

model;
c*theta*h^(1+psi)=(1-alpha)*y;
k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
*(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
k = exp(b)*(y-c)+(1-delta)*k(-1);
a = rho*a(-1)+tau*b(-1) + e;
b = tau*a(-1)+rho*b(-1) + u;
end;

initval;
y = 1.08068253095672;
c = 0.80359242014163;
h = 0.29175631001732;
k = 5;
a = 0;
b = 0;
e = 0;
u = 0;
end;

shocks(shock_file=shocks1);
//var e; stderr 0.009;
//var u; stderr 0.009;
//var e, u = phi*0.009*0.009;
//var e, u = phi*0.009*0.009;
var e;
periods 1:5;
values 0.01;
end;

stoch_simul(linear);
*************************************************************



**********************************
Naohisa Hirakata
Macro Modelling
Research and Statistics Department
Bank of Japan
TEL: +81-3-3279-1111 (ext. 3847)
FAX: +81-3-5255-6758
EMAIL: naohisa.hirakata@boj.or.jp
**********************************

PostPosted: Sat Jun 17, 2006 2:21 pm
by MichelJuillard
There are three problems:

1) You refer to file shocks1, but don't seem to use it. Drop the shock_fille option

2) You need at least one stochastic shock. Declare some stdandard deviation for u

3) You won't see the effect of the deterministic shocks, unless you ask for forecast. For example:
forecast(periods=40);

Best

Michel

Thank you very much.

PostPosted: Thu Jun 22, 2006 10:33 am
by hk
Dear Professor Juillard,

Thanks for your answer.
This program worked, thank to your reply. I succeded in inputing the exogenous variable.
I do appreciate your help.

Your Sincerely,
Naohisa

Re: Input exogenous variables

PostPosted: Fri Nov 23, 2012 8:08 pm
by diego.gomes
MichelJuillard wrote:There are three problems:



1) You refer to file shocks1, but don't seem to use it. Drop the shock_fille option



2) You need at least one stochastic shock. Declare some stdandard deviation for u



3) You won't see the effect of the deterministic shocks, unless you ask for forecast. For example:

forecast(periods=40);



Best



Michel


Michel, I did what you said. When I simulate the stochastic model with and without the deterministic shock, the chart generated by the forecast command looks different.

But, the time series for the exogenous variables in both cases are exactly the same. Why does it happens?

Re: Input exogenous variables

PostPosted: Mon Jan 07, 2013 4:32 pm
by SébastienVillemot
diego.gomes wrote:But, the time series for the exogenous variables in both cases are exactly the same. Why does it happens?


You mean the stochastic exogenous, or the deterministic exogenous? Because if it's the former, then this is normal, because stochastic and deterministic exogenous shocks are independent with each other.