Page 1 of 1

A question on impluse reponse function and "stoch_simul"

PostPosted: Thu Apr 15, 2010 3:25 am
by miao
Hi,

I have a simple dynare program to calculate the impulse response of an AR1 system:
Three commands, "shock", "estimation" and "stoch_simul" are applied in order. Does the "stoch_simul" calculate the impulse response produced by "estimation" rather than "shock"? Is the "shock" block redundant in this case?
If we consider a bigger macro-money model, is it the case that we can compute only the reponse of endogenous variables to "one-standard-deviation shock" to the policy rate equation rather than to "one-percent-point rate cut"? Is there an easy way to calculate the IRF to "one-percent-point rate cut"?

Thanks,

Miao



var r;
varexo a ;
parameters phi0 phi1;

phi0=1;
phi1=0.8;

model;

r = phi0 + phi1*(r(-1))+a;

end;

shocks;
// This line seems to be quite unrelated to the results?
var a; stderr 0.1;

end;

varobs r;


estimated_params;
phi0, 1, 0.01,10;
phi1, 0.8, 0.01,1;
stderr a, 1, 0.01,10;
end;


steady;
check;

options_.kalman_algo = 5;
estimation(datafile=datatest100_100414_std1, nobs=100, mode_compute=4, mode_check, mh_replic=0);
stoch_simul(linear,irf=10);

Re: A question on impluse reponse function and "stoch_simul"

PostPosted: Sun Apr 18, 2010 7:36 pm
by p.gelain
If you estimate the shock standard deviation I think dynare takes that value in computing the IRF. So as you said the shock block is redundant. If you want to compute the response of endogenous variable to one-percent-point rate cut, using estimated values, a strategy would be to use the shock block to set the standard deviations of all the parameter at their estimated values normalized by the monetary policy shock standard deviation. In fact if you divide the monetary policy shock standard deviation by itself you obtain 1 (so 1% change in interest rate). In dividing all the other standard deviations by the monetary policy shock you obtain consistent IRFs.

Paolo

Re: A question on impluse reponse function and "stoch_simul"

PostPosted: Mon Apr 19, 2010 5:35 pm
by otb
You can also use the relative_irf option with stoch_simul. This will generate impulses relative for a 100 basis points change in the interest rate.

Re: A question on impluse reponse function and "stoch_simul"

PostPosted: Tue Apr 20, 2010 9:04 am
by miao
Thanks for the replies by p.gelain and otb.

Let me ask one fundamental question:
Consider the simple AR1 model r = phi0 + phi1*(r(-1))+a; where phi0=1.5; phi1=0.5; a~N(0, std=0.8). (the program is shown at the bottom of the post, modified from my first post on this topic). It is easy to see that the impulse response is 0.8 at time 0 , 0.4 at time 1, and 0.2 at time 2, etc. However the time convention in Dynare seems to be different from mine, which makes the IRF 0.8 at time 1 , 0.4 at time 2, and 0.2 at time 3, etc?
My first major question is: how is the IRF computed in Dynare?
If I do it by hand, I will set a=0.8 at time 0 and then solve the equation in r. By iteration, we will find r(t+1), r(t+2).....The difference between r(t+n) after shock and r(t+n) without any shock is the IRF. Is it what dynare does?
How does the function work if we use "data (real or simulated)" and the function "estimation" before "stoch_simul"?
Does the function "stoch_simul" employ any random number generator? I didn't find any Matlab random number generator in the source code of function stoch_simul. Why do we call it "STOCHASTIC" simulation?

Your help is highly appreciated!

var r;
varexo a ;
parameters phi0 phi1;

phi0=1.5;
phi1=0.5;

model;

r = phi0 + phi1*(r(-1))+a;

end;

shocks;

var a; stderr 0.8;

end;

stoch_simul(order=1,irf=10,simul_seed=1);

Re: A question on impluse reponse function and "stoch_simul"

PostPosted: Tue Apr 20, 2010 9:04 am
by miao
Thanks for the replies by p.gelain and otb.

Let me ask one fundamental question:
Consider the simple AR1 model r = phi0 + phi1*(r(-1))+a; where phi0=1.5; phi1=0.5; a~N(0, std=0.8). (the program is shown at the bottom of the post, modified from my first post on this topic). It is easy to see that the impulse response is 0.8 at time 0 , 0.4 at time 1, and 0.2 at time 2, etc. However the time convention in Dynare seems to be different from mine, which makes the IRF 0.8 at time 1 , 0.4 at time 2, and 0.2 at time 3, etc?
My first major question is: how is the IRF computed in Dynare?
If I do it by hand, I will set a=0.8 at time 0 and then solve the equation in r. By iteration, we will find r(t+1), r(t+2).....The difference between r(t+n) after shock and r(t+n) without any shock is the IRF. Is it what dynare does?
How does the function work if we use "data (real or simulated)" and the function "estimation" before "stoch_simul"?
Does the function "stoch_simul" employ any random number generator? I didn't find any Matlab random number generator in the source code of function stoch_simul. Why do we call it "STOCHASTIC" simulation?

Your help is highly appreciated!

var r;
varexo a ;
parameters phi0 phi1;

phi0=1.5;
phi1=0.5;

model;

r = phi0 + phi1*(r(-1))+a;

end;

shocks;

var a; stderr 0.8;

end;

stoch_simul(order=1,irf=10,simul_seed=1);