# Specified covariances for the structural errors are not consistent with the variances

**URL:** https://forum.dynare.org/t/specified-covariances-for-the-structural-errors-are-not-consistent-with-the-variances/18147
**Category:** Stochastic simulations
**Created:** [22 May 2021 16:20 UTC](https://forum.dynare.org/t/specified-covariances-for-the-structural-errors-are-not-consistent-with-the-variances/18147 "2021-05-22T16:20:17Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![SarvinSharif](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/ac91a4/32.png) [@SarvinSharif](https://forum.dynare.org/u/SarvinSharif)
#### Post date: [22 May 2021 16:20 UTC](https://forum.dynare.org/t/specified-covariances-for-the-structural-errors-are-not-consistent-with-the-variances/18147/1 "2021-05-22T16:20:17Z")

</div>

Dear all,  
I am working with a CIA model and when I want to deal with correlated shocks I get this error  
The specified covariances for the structural errors are not consistent with the  
variances as they imply a correlation larger than ±1  
I can not figure out what is wrong.  
Moreover, when I want to setting up correlation between three or more shocks I get the error saying  
ERROR: finalround.mod: line 171, col 16: syntax error, unexpected COMMA, expecting EQUAL  
Do I have to do this procedure two by two? Or there is something wrong with my code?

[finalround.mod](https://forum.dynare.org/uploads/short-url/8Kb609MyTr0bhIaGBzY27FIEpMK.mod) (4.9 KB)

Thanks in advance.

---

<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: [23 May 2021 08:35 UTC](https://forum.dynare.org/t/specified-covariances-for-the-structural-errors-are-not-consistent-with-the-variances/18147/2 "2021-05-23T08:35:15Z")

</div>

If your variances are 0.01, you cannot have a covariance of 2.5

```auto
corr e_o, e_to = 0.5;

```

Also, you can only specify bilateral relations. You need something along the lines of

```auto
shocks; 
var e_A; stderr 0.01;
var e_g; stderr 0.01;  
var e_sub; stderr 0.01; 
var e_o; stderr 0.01; 
var e_tfy; stderr 0.01;
var e_tfx; stderr 0.01;
var e_tfc; stderr 0.01;
var e_tx; stderr 0.01;
corr e_o, e_to = 0.5;
%var e_tx, e_tfy = -1.5;
%var e_tx, e_tfx = -1.5;
%var e_tx, e_tfc = -1.5;
corr e_tx, e_tfy= 0.9;
corr e_tx, e_tfc= 0.9;
corr e_tx, e_tfx= 0.9;
corr e_tfy, e_tfc= 0.9;
corr e_tfy, e_tfx= 0.9;
corr e_tfx, e_tfc= 0.9;
%var e_tc; stderr 0.01;

var e_to; stderr 0.01;
%var e_mb; stderr 0.01;
end;

```

---

<div class="post-metadata">

### Author: ![SarvinSharif](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/ac91a4/32.png) [@SarvinSharif](https://forum.dynare.org/u/SarvinSharif)
#### Post date: [29 May 2021 10:56 UTC](https://forum.dynare.org/t/specified-covariances-for-the-structural-errors-are-not-consistent-with-the-variances/18147/3 "2021-05-29T10:56:19Z")

</div>

Sorry for my late response.  
Thank you very for your help. I applied the your corrections and the problem is solved.

---

<div class="post-metadata">

### Author: ![He98](https://forum.dynare.org/letter_avatar_proxy/v4/letter/h/77aa72/32.png) [@He98](https://forum.dynare.org/u/He98)
#### Post date: [17 September 2022 09:22 UTC](https://forum.dynare.org/t/specified-covariances-for-the-structural-errors-are-not-consistent-with-the-variances/18147/5 "2022-09-17T09:22:07Z")

</div>

Hello everyone, I hope you are well.

I would like to know please, does the eu model specification as SarvinSharif made it require to have the data to launch the model? Or do we calculate the standard deviations, variances and covariances with the data that we just put in the model? I would like to know please, if it is possible for the model to call on the data of the defined variables and how? thank you all!

---

<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: [19 September 2022 07:14 UTC](https://forum.dynare.org/t/specified-covariances-for-the-structural-errors-are-not-consistent-with-the-variances/18147/6 "2022-09-19T07:14:04Z")

</div>

The simulated model does not make reference to any data. But you may use the data to inform your parameter settings.

---

<div class="post-metadata">

### Author: ![He98](https://forum.dynare.org/letter_avatar_proxy/v4/letter/h/77aa72/32.png) [@He98](https://forum.dynare.org/u/He98)
#### Post date: [19 September 2022 09:51 UTC](https://forum.dynare.org/t/specified-covariances-for-the-structural-errors-are-not-consistent-with-the-variances/18147/7 "2022-09-19T09:51:30Z")

</div>

Thank you Professor for answering me and I understood very well.

Thank you, you are the best!
