# Error in computing likelihood for initial parameter values

**URL:** https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808
**Category:** Dynare help (legacy posts)
**Created:** [4 April 2014 00:32 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808 "2014-04-04T00:32:05Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![donald.ma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/e5b9ba/32.png) [@donald.ma](https://forum.dynare.org/u/donald.ma)
#### Post date: [4 April 2014 00:32 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/1 "2014-04-04T00:32:05Z")

</div>

Hi,I am a new learner. When I try estimated a model ,dynare warned me the error:

There are 11 eigenvalue(s) larger than 1 in modulus  
for 13 forward-looking variable(s)

The rank conditions ISN’T verified!

You did not declare endogenous variables after the estimation/calib\_smoother command.  
Loading 36 observations from lindata.xls

Error in computing likelihood for initial parameter values  
Error using print\_info (line 43)  
Blanchard Kahn conditions are not satisfied: indeterminacy  
Error in initial\_estimation\_checks (line 69)  
print\_info(info, DynareOptions.noprint)  
Error in dynare\_estimation\_1 (line 169)  
oo\_ = initial\_estimation\_checks(objective\_function,xparam1,dataset\_,M\_,estim\_params\_,options\_,bayestopt\_,oo\_);  
Error in dynare\_estimation (line 70)  
dynare\_estimation\_1(var\_list,dname);  
Error in lin (line 395)  
dynare\_estimation(var\_list\_);  
Error in dynare (line 120)  
evalin(‘base’,fname) ;

what should I do next? Thank you for your help.I attached my codes and data file here.  
[lin.mod](https://forum.dynare.org/uploads/default/original/2X/6/65c4271ff9f8fbd372e42fc523d2b3c859a9a3ad.mod) (5.66 KB)  
[lindata.xls](https://forum.dynare.org/uploads/default/original/2X/f/f0e1389b19f5269b3bcf1d2bca0ffd16e85928f2.xls) (25.5 KB)

---

<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: [4 April 2014 08:31 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/2 "2014-04-04T08:31:19Z")

</div>

You have to fix your model for simulation first. That the Blanchard-Kahn conditions are violated suggests a timing error. The model\_diagnostics provides a hint:

[quote]The following endogenous variables aren’t present at the current period in the model:  
var\_epi[/quote]

---

<div class="post-metadata">

### Author: ![donald.ma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/e5b9ba/32.png) [@donald.ma](https://forum.dynare.org/u/donald.ma)
#### Post date: [16 April 2014 23:37 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/3 "2014-04-16T23:37:18Z")

</div>

[quote=“jpfeifer”]You have to fix your model for simulation first. That the Blanchard-Kahn conditions are violated suggests a timing error. The model\_diagnostics provides a hint:

[quote]The following endogenous variables aren’t present at the current period in the model:  
var\_epi[/quote]

[/quote]

thank you for you advise. I will try it again.

---

<div class="post-metadata">

### Author: ![donald.ma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/e5b9ba/32.png) [@donald.ma](https://forum.dynare.org/u/donald.ma)
#### Post date: [16 April 2014 23:51 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/4 "2014-04-16T23:51:04Z")

</div>

[quote=“jpfeifer”]You have to fix your model for simulation first. That the Blanchard-Kahn conditions are violated suggests a timing error. The model\_diagnostics provides a hint:

[quote]The following endogenous variables aren’t present at the current period in the model:  
var\_epi[/quote]

[/quote]

by the way,where can I see the hint in the program?

---

<div class="post-metadata">

### Author: ![donald.ma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/e5b9ba/32.png) [@donald.ma](https://forum.dynare.org/u/donald.ma)
#### Post date: [17 April 2014 01:16 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/5 "2014-04-17T01:16:20Z")

</div>

I fix my program. There are still a problem.

There are 10 eigenvalue(s) larger than 1 in modulus  
for 13 forward-looking variable(s)

The rank conditions ISN’T verified!

You did not declare endogenous variables after the estimation/calib\_smoother command.  
Loading 36 observations from lindata.xls

Error in computing likelihood for initial parameter values  
Error using print\_info (line 43)  
Blanchard Kahn conditions are not satisfied: indeterminacy  
Error in initial\_estimation\_checks (line 69)  
print\_info(info, DynareOptions.noprint)  
Error in dynare\_estimation\_1 (line 169)  
oo\_ = initial\_estimation\_checks(objective\_function,xparam1,dataset\_,M\_,estim\_params\_,options\_,bayestopt\_,oo\_);  
Error in dynare\_estimation (line 70)  
dynare\_estimation\_1(var\_list,dname);  
Error in lin (line 436)  
dynare\_estimation(var\_list\_);  
Error in dynare (line 120)  
evalin(‘base’,fname) ;

> >

what should i do next? thank you very much.  
[lindata.xls](https://forum.dynare.org/uploads/default/original/2X/f/f0e1389b19f5269b3bcf1d2bca0ffd16e85928f2.xls) (25.5 KB)  
[lin.mod](https://forum.dynare.org/uploads/default/original/2X/a/ad540d408388c94f5ab9b98a24800a656b81707a.mod) (6.36 KB)

---

<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 April 2014 10:26 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/6 "2014-04-17T10:26:26Z")

</div>

Typically, this is a timing issue. Check your model. As you are the only one knowing your model, the forum will not provide help here.

Given the size of your model, start from a stripped down easier version and make sure that one runs before expanding it again.

---

<div class="post-metadata">

### Author: ![donald.ma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/e5b9ba/32.png) [@donald.ma](https://forum.dynare.org/u/donald.ma)
#### Post date: [18 April 2014 00:17 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/7 "2014-04-18T00:17:51Z")

</div>

[quote=“jpfeifer”]Typically, this is a timing issue. Check your model. As you are the only one knowing your model, the forum will not provide help here.

Given the size of your model, start from a stripped down easier version and make sure that one runs before expanding it again.[/quote]

thank you very much. I have checked my model ,and solve this problem.

And another problem:

“Error using chol  
Matrix must be positive definite.”

I solove this problem by add “mode\_compute=6”. If someoneelse have the same problem, you can solve it like me . I write here to help somebody else.

Thank you for your help again, you do not know what a fave you do for me.

by the way,“The following endogenous variables aren’t present at the current period in the model:  
var\_epi”,how can you find this? by examing the model, or there is a way by DYNARE?

---

<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: [18 April 2014 10:35 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/8 "2014-04-18T10:35:18Z")

</div>

See the manual for

> [@](#):
>
> model\_diagnostics

---

<div class="post-metadata">

### Author: ![RMB](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/b19c9b/32.png) [@RMB](https://forum.dynare.org/u/RMB)
#### Post date: [3 June 2014 04:28 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/9 "2014-06-03T04:28:23Z")

</div>

Hi,

I’m newer here. I have a problem with my code - I’m trying to write the code for chapter 3 of Gali 2008, but I’m having successful.  
Here my problems:

dynare gali2008.mod

Configuring Dynare …  
[mex] Generalized QZ.  
[mex] Sylvester equation solution.  
[mex] Kronecker products.  
[mex] Sparse kronecker products.  
[mex] Bytecode evaluation.  
[mex] k-order perturbation solver.  
[mex] k-order solution simulation.

Starting Dynare (version 4.2.5).  
Starting preprocessing of the model file …  
Found 17 equation(s).  
Evaluating expressions…done  
Computing static model derivatives:

- order 1  
Computing dynamic model derivatives:
- order 1
- order 2  
Processing outputs …done  
Preprocessing completed.  
Starting MATLAB/Octave computing.

Warning: usage: [bnds,rowd,sens,rowp,rowg] = mu(matin,blk,opt)

> In mu at 45  
> In gali2008 at 171  
> In dynare at 120  
> Error in ==\> mu at 44  
> if nargin \< 1 | nargin \> 4

??? Output argument “bnds” (and maybe others) not assigned during call to  
“/Applications/MATLAB\_R2009b.app/toolbox/robust/rctobsolete/mutools/commands/mu.m\>mu”.

Error in ==\> gali2008 at 171  
M\_.params( 15 ) =  
(-((1-M\_.params(4))\*(mu-log(1-M\_.params(4)))))/(M\_.params(4)+(1-M\_.params(4))\*M\_.params(1)+M\_.params(2));

Error in ==\> dynare at 120  
evalin(‘base’,fname) ;

I’m sending the code for anyone that want to help see and give me a hint.

Thanks a lot.  
[gali2008.mod](https://forum.dynare.org/uploads/default/original/2X/f/f6091a67cbcb03c12a400ef66729c87fe879695e.mod) (4.51 KB)

---

<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: [3 June 2014 06:26 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/10 "2014-06-03T06:26:24Z")

</div>

See Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models” [sites.google.com/site/pfeiferecon/Pfeifer\_2013\_Observation\_Equations.pdf](https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf), Remark 3 (Variable Naming in Matlab and Dynare).  
The naming of the parameter with mu conflicts with Matlab. Also see [sites.google.com/site/pfeiferecon/Gali2008\_chapter3.mod](https://sites.google.com/site/pfeiferecon/Gali2008_chapter3.mod)

---

<div class="post-metadata">

### Author: ![RMB](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/b19c9b/32.png) [@RMB](https://forum.dynare.org/u/RMB)
#### Post date: [4 June 2014 08:19 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/11 "2014-06-04T08:19:10Z")

</div>

[quote=“jpfeifer”]See Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models” [sites.google.com/site/pfeiferecon/Pfeifer\_2013\_Observation\_Equations.pdf](https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf), Remark 3 (Variable Naming in Matlab and Dynare).  
The naming of the parameter with mu conflicts with Matlab. Also see [sites.google.com/site/pfeiferecon/Gali2008\_chapter3.mod](https://sites.google.com/site/pfeiferecon/Gali2008_chapter3.mod)[/quote]

Thanks, Pfeiter. Your material is awesome, I will review in a good moment, as soon as possible.  
Your hint works to me, the naming mu wasn’t good and so I renamed to mi.  
But I still have problems with B-K conditions. I organized better my equations, included more than Gali2008\_chapter3.mod (also, I included more variables, as wages, prices and prices that "maximized the market value of profits…"as described in Gali (2008, 44) - pstar.

I think I am adding some no necessary equation in place of a really necessary equation, but I don’t see what, and a better way is understand better what Matlab is saying with:

> > dynare gali2008rev

Configuring Dynare …  
[mex] Generalized QZ.  
[mex] Sylvester equation solution.  
[mex] Kronecker products.  
[mex] Sparse kronecker products.  
[mex] Bytecode evaluation.  
[mex] k-order perturbation solver.  
[mex] k-order solution simulation.

Starting Dynare (version 4.2.5).  
Starting preprocessing of the model file …  
Found 15 equation(s).  
Evaluating expressions…done  
Computing static model derivatives:

- order 1  
Computing dynamic model derivatives:
- order 1  
Processing outputs …done  
Preprocessing completed.  
Starting MATLAB/Octave computing.

STEADY-STATE RESULTS:

y -0.195929  
c -0.195929  
n -0.293893  
w 0.510178  
p 1  
i 0.0100503  
pi 0  
a 0  
pstar 1  
m 0.76387  
yn -0.195929  
rn 0.0100503  
v 0  
ytil 0  
rreal 0.0100503

EIGENVALUES:  
Modulus Real Imaginary

```
           0 0 0
         0.5 0.5 0
         0.9 0.9 0
           1 1 0
       1.153 1.132 0.2197
       1.153 1.132 -0.2197
         Inf Inf 0

```

There are 3 eigenvalue(s) larger than 1 in modulus  
for 4 forward-looking variable(s)

The rank conditions ISN’T verified!

??? Error using ==\> print\_info at 43  
Blanchard Kahn conditions are not satisfied: indeterminacy

Error in ==\> stoch\_simul at 71  
print\_info(info, options\_.noprint);

Error in ==\> gali2008rev at 218  
info = stoch\_simul(var\_list\_);

Error in ==\> dynare at 120  
evalin(‘base’,fname) ;

The part of:  
"There are 3 eigenvalue(s) larger than 1 in modulus  
for 4 forward-looking variable(s)

The rank conditions ISN’T verified!

??? Error using ==\> print\_info at 43  
Blanchard Kahn conditions are not satisfied: indeterminacy"

is not clear to me, where I have to look for?  
I am attaching a new file again.

Thank you very much for your reply.  
[gali2008rev.mod](https://forum.dynare.org/uploads/default/original/2X/3/3056eb26dd855b2247ea10dbe01dc7dd90180bf5.mod) (4.54 KB)

---

<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: [6 June 2014 18:26 UTC](https://forum.dynare.org/t/error-in-computing-likelihood-for-initial-parameter-values/3808/12 "2014-06-06T18:26:08Z")

</div>

You cannot consider wages, money demand and prices.  
The reason is that under an interest rate rule nominal prices are indeterminate. You can determine relative prices but not the nominal ones. Hence, you can determine the real wage (w-p) and real money balances (m-p) but not their individual components.
