# Mode check-shock variance log likelihood kernel is flat

**URL:** <https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385>\
**Category:** Dynare help (legacy posts)\
**Created:** [12 September 2013 19:08 UTC](https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385 "2013-09-12T19:08:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigbig001](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@bigbig001](https://forum.dynare.org/u/bigbig001)\
**Post date:** [12 September 2013 19:08 UTC](https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385/1 "2013-09-12T19:08:59Z")

</div>

Hi,  
I am working on DSGE Bayesian estimation. I found out that the green line (log likelihood kernel) in mode check for all the shock variances are always flat (i tried different versions of model specification but I always have this problem). I was wondering if this is a big problem and how to solve it. In MCMC diagnostic graph, these variances tend to converge very slowly compared to other parameters.

I appreciate any help on 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:** [14 September 2013 08:18 UTC](https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385/2 "2013-09-14T08:18:18Z")

</div>

For estimation, this is a bad sign. Your variances are not identified from the data. Thus, your prior will be your posterior. Try using the identification command to see if this is really the case.

---

<div class="post-metadata">

**Author:** ![bigbig001](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@bigbig001](https://forum.dynare.org/u/bigbig001)\
**Post date:** [15 September 2013 02:45 UTC](https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385/3 "2013-09-15T02:45:38Z")

</div>

Thanks a lot, jpfeifer.  
I did the identification test but the program stopped in the sensitivity analysis. The message dynare gave me is:

STEADY: numerical initial values or parameters incompatible with the following equations  
1 2 3 4 13 14 20 30  
Please check for example  
i) if all parameters occurring in these equations are defined  
ii) that no division by an endogenous variable initialized to 0 occurs  
All parameter values in the specified ranges are not acceptable!

I calculated the steady state by hand and set the initial values equal to the steady state. I use resid(1) to check the initial values and the residuals of all equations are 0. I think all the initial values are correct steady states. I am confused about this message.

I was wondering what is wrong with model or estimation.

Thanks a lot

---

<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:** [15 September 2013 08:11 UTC](https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385/4 "2013-09-15T08:11:17Z")

</div>

Please provide the mod-file

---

<div class="post-metadata">

**Author:** ![bigbig001](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@bigbig001](https://forum.dynare.org/u/bigbig001)\
**Post date:** [15 September 2013 15:55 UTC](https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385/5 "2013-09-15T15:55:34Z")

</div>

Thanks a lot, jpfeifer  
Here is my mod file and data file. My model is similar to Iacoveillo (2010), but much more simplified. And I am using demeaned log difference of GDP,consumption, investment and housing price, which are stationary.

---

<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:** [16 September 2013 12:36 UTC](https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385/6 "2013-09-16T12:36:30Z")

</div>

This is a quasi-bug in Dynare. Your combination of using a parameter defined within the shocks-block to estimate a variance does not work. Instead of

[code]shocks;  
var ec;sicg^2;  
end;

estimated\_params;  
sigc, inv\_gamma\_PDF,0.05,0.1;  
end;  
[/code]  
use

[code]shocks;  
var ec;sicg^2;  
end;

estimated\_params;  
stderr ec, inv\_gamma\_PDF,0.05,0.1;  
end;  
[/code]

---

<div class="post-metadata">

**Author:** ![bigbig001](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@bigbig001](https://forum.dynare.org/u/bigbig001)\
**Post date:** [17 September 2013 00:00 UTC](https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385/7 "2013-09-17T00:00:56Z")

</div>

Thanks a lot, Jpfeifer.  
The standard deviation of shocks are identified after I modified my code. I really appreciate your help. I have been struggling on this problem for a month and tried many different model specifications. I was desperate. Thanks very much.

But I still get the same error message when I run the sensitivity analysis:  
STEADY: numerical initial values or parameters incompatible with the following equations  
1 2 3 4 13 14 20 30  
Please check for example  
i) if all parameters occurring in these equations are defined  
ii) that no division by an endogenous variable initialized to 0 occurs  
All parameter values in the specified ranges are not acceptable!

The initial values were the actual steady states which were calculated by hand and the the residues of all equations are 0 with resid(1). I am confused about this message.

---

<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:** [17 September 2013 08:24 UTC](https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385/8 "2013-09-17T08:24:42Z")

</div>

Your computed steady state is for the calibrated model. But it is not correctly updated for the estimated values. You might need a steady state file to do this.

---

<div class="post-metadata">

**Author:** ![bigbig001](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@bigbig001](https://forum.dynare.org/u/bigbig001)\
**Post date:** [21 September 2013 14:43 UTC](https://forum.dynare.org/t/mode-check-shock-variance-log-likelihood-kernel-is-flat/3385/9 "2013-09-21T14:43:22Z")

</div>

Thanks a lot, jpfeifer.  
I will write a separate steady state file and try again.
