# Common Shocks and something else

**URL:** <https://forum.dynare.org/t/common-shocks-and-something-else/4488>\
**Category:** Dynare help (legacy posts)\
**Created:** [19 February 2015 19:39 UTC](https://forum.dynare.org/t/common-shocks-and-something-else/4488 "2015-02-19T19:39:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![salkiewi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/8797f3/32.png) [@salkiewi](https://forum.dynare.org/u/salkiewi)\
**Post date:** [19 February 2015 19:39 UTC](https://forum.dynare.org/t/common-shocks-and-something-else/4488/1 "2015-02-19T19:39:48Z")

</div>

Hi there,

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

` 
        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

`
                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

`
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?

```auto
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

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [20 February 2015 07:02 UTC](https://forum.dynare.org/t/common-shocks-and-something-else/4488/2 "2015-02-20T07:02:16Z")

</div>

You can implement a correlated shock by adding a common shock, but I would go for the regular interface. For this purpose, use

`
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

```auto

```

and not

```auto

```

---

<div class="post-metadata">

**Author:** ![salkiewi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/8797f3/32.png) [@salkiewi](https://forum.dynare.org/u/salkiewi)\
**Post date:** [20 February 2015 08:19 UTC](https://forum.dynare.org/t/common-shocks-and-something-else/4488/3 "2015-02-20T08:19:50Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![salkiewi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/8797f3/32.png) [@salkiewi](https://forum.dynare.org/u/salkiewi)\
**Post date:** [20 February 2015 10:01 UTC](https://forum.dynare.org/t/common-shocks-and-something-else/4488/4 "2015-02-20T10:01:44Z")

</div>

I just encountered new difficulties.  
That is, I have some problems to figure out how to correctly code the ‘∆w’ process.

```auto
        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:

```auto
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

```auto
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 🙂

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [22 February 2015 19:13 UTC](https://forum.dynare.org/t/common-shocks-and-something-else/4488/5 "2015-02-22T19:13:01Z")

</div>

Regarding the sigma\_v, it does not matter what you do. Either you set

` var e_v = sigma_v^2;
`  
in the shocks block and delete the sigma\_v in the model or you set

` 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.

---

<div class="post-metadata">

**Author:** ![salkiewi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/8797f3/32.png) [@salkiewi](https://forum.dynare.org/u/salkiewi)\
**Post date:** [23 February 2015 10:20 UTC](https://forum.dynare.org/t/common-shocks-and-something-else/4488/6 "2015-02-23T10:20:21Z")

</div>

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:

```auto
 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.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [24 February 2015 11:03 UTC](https://forum.dynare.org/t/common-shocks-and-something-else/4488/7 "2015-02-24T11:03:06Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![salkiewi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/8797f3/32.png) [@salkiewi](https://forum.dynare.org/u/salkiewi)\
**Post date:** [24 February 2015 13:02 UTC](https://forum.dynare.org/t/common-shocks-and-something-else/4488/8 "2015-02-24T13:02:58Z")

</div>

Great! Many many thanks!
