Page 1 of 1

Common Shocks and something else

PostPosted: Thu Feb 19, 2015 7:39 pm
by salkiewi
Hi there,

I have a question concerning the 'shocks' block. That is, I have the following dynamics:

Code: Select all
 
        da(+1) = mu + x + zeta*w + exp(v)*sigma_a*e_a(+1);
        x(+1)  = rho_x* x + exp(v)*sigma_x*e_x(+1);
        v      = rho_v*v(-1) - sigma_v*e_x;
        dw(+1) = mu + (rho_w - 1) * (w - a) + kappa*x + sigma_w*e_w(+1);


in the model part. I also have the values for the sigmas, which I declared in the parameters block

Code: Select all
                sigma_a        = 0.0052;
                sigma_v        = 0.01;
                sigma_w        = 0.024;
                sigma_x        = 0.00052


And: e_a and e_x are correlated: rho_a,x = 0.3

My questions:

1) How do I proceed in the shock part if I have the sigmas?

a) Do I just write

Code: Select all
var e_a = sigma_a^2;           // Volatility of Short Run Shocks 
var e_x = sigma_x^2;          // Volatility of Long Run Shocks
corr e_a, e_x = 0.3;         // Correlation of Short and Long Run Shocks
var e_w = sigma_w^2;            // Volatility of Oil Supply;


b) And if I do so, do I have to omit the sigma-terms in the dynamics? e.g. omit 'sigma_a*e_a(+1)' in da(+1)?
Or how do I do it?

2)My suggestion is probably partly wrong since - as one can see - v and x(+1) share a common shock, i.e. e_x.
Is it possible to maybe do it like this?

Code: Select all
var e_a(+1) = sigma_a^2;           
var e_x(+1) = sigma_x^2;         
corr e_a(+1), e_x(+1) = 0.3;
var e_x = sigma_v^2;
var e_w(+1) = sigma_w^2;


Would be really great if someone could help me.
I would highly appreciate it.

Best,
Stefan

Re: Common Shocks and something else

PostPosted: Fri Feb 20, 2015 7:02 am
by jpfeifer
You can implement a correlated shock by adding a common shock, but I would go for the regular interface. For this purpose, use
Code: Select all
shocks;
var e_a = sigma_a^2;           // Volatility of Short Run Shocks
var e_x = sigma_x^2;          // Volatility of Long Run Shocks
corr e_a, e_x = 0.3;         // Correlation of Short and Long Run Shocks
var e_w = sigma_w^2;            // Volatility of Oil Supply;
end;

This specifies the covariance matrix of your shock. Because of this, do not put sigmas in the model block as you variance would then become sigma_a^4.

Lastly, your timing is weird. It almost never happens that you have leaded shocks enter equations. In the shocks-block, this should not even be allowed by Dynare. It looks as if you try to specify exogenous processes. They must be entered in the form
Code: Select all
x=rho*x(-1)+epsilon

and not
Code: Select all
x(+1)=rho*x+epsilon(+1)

Re: Common Shocks and something else

PostPosted: Fri Feb 20, 2015 8:19 am
by salkiewi
Great! Many thanks for your helpful response!

Just one tiny little request:
What do I do with the sigma_v from the volatility process, v?
Do I just leave this volatility in the model block but omit the others if I specify the shock block as you suggested?

Many many thanks in advance!

Re: Common Shocks and something else

PostPosted: Fri Feb 20, 2015 10:01 am
by salkiewi
I just encountered new difficulties.
That is, I have some problems to figure out how to correctly code the '∆w' process.

Code: Select all
        da     = mu + x(-1)  + zeta*w + exp(v)*e_a;
        x      = rho_x * x(-1) + exp(v)*e_x;
        v      = rho_v*v(-1) - sigma_v*e_x;
        dw     = mu + (rho_w - 1) * (w(-1) - a(-1)) + kappa*x(-1) + e_w;


The problem is that within the process, I have 'a(-1)' and 'w(-1)' as log levels rather than growth rates.
My guess is that Dynare will not like it when I try to run the code since these variables are nowhere specified, right?
How could solve this? Just by writing:

Code: Select all
a(-1)  = a - da
w(-1) = w -dw


But wouldnt that just be the same problem?; just rephrased since I dont have a and w after all?

Btw,

da = Productivity growth process (labor augmenting)
x = Long run risk component
v = Stochastic vola
dw= Oil supply growth process

In the model, I just have the identity
Code: Select all
W = G + O

--> Oil supply is allocated to the household sector for 'oil consumption' (G_t) and to the firm sector in which it enters the production function (O_t).

Many many thanks for any comments and suggestions!
Would highly appreciate it :)

Re: Common Shocks and something else

PostPosted: Sun Feb 22, 2015 7:13 pm
by jpfeifer
Regarding the sigma_v, it does not matter what you do. Either you set
Code: Select all
 var e_v = sigma_v^2;

in the shocks block and delete the sigma_v in the model or you set
Code: Select all
 var e_v = 1;

and keep the sigma_v. What you cannot do is leave sigma_v from the shocks block as this will set the variance to 0.
Regarding the second question: you need to find recursive representations or definitions for all variables in your model. If da and dw are exogenous processes, you can use the random walk definitions you posted.

Re: Common Shocks and something else

PostPosted: Mon Feb 23, 2015 10:20 am
by salkiewi
Many thanks for the response. Helps a lot!
Just a little request, again. (Sorry for that.)

--> What I don't get is the following:

Let's say I incorporate sigma_v as you mentioned:

Code: Select all
 var e_v = sigma_v^2;


From my point of view, there is the problem that I dont have "e_v" in my dynamics - which, btw, are exogenous.
Or doesn't it matter?
Sorry, if this might seem like a lame question. But I don't get how it would affect v if I do it like this since v is exposed to e_x.

Many thanks in advance.


Ps.: Concerning the second question. Perfect. I gonna try it like this.

Re: Common Shocks and something else

PostPosted: Tue Feb 24, 2015 11:03 am
by jpfeifer
I may have misunderstood you. e_x seems to be a shock that jointly enters two equations. Of course, you can only specify one variance for it in the shocks block. The sigma_v in the law of motion for v only rescales the standard deviation. Thus, you want

Code: Select all
model;
...
x  = rho_x* x(-1) + exp(v)*e_x;
v  = rho_v*v(-1) - sigma_v/sigma_x*e_x;
end;

shocks;
var e_a = sigma_a^2;           // Volatility of Short Run Shocks
var e_x = sigma_x^2;          // Volatility of Long Run Shocks
corr e_a, e_x = 0.3;         // Correlation of Short and Long Run Shocks
var e_w = sigma_w^2;            // Volatility of Oil Supply;
end;

That way, you have the correlation between e_a and e_x and that the shock to e_x enters both equations. At the same time, the shock term e_x in the first equation has variance sigma_x^2, while in the second equation it is
var(sigma_v/sigma_x*e_x)=sigma_v^2/sigma_x^2*sigma_x^2=sigma_v^2.

Re: Common Shocks and something else

PostPosted: Tue Feb 24, 2015 1:02 pm
by salkiewi
Great! Many many thanks!