# Rank condition not satisfied

**URL:** <https://forum.dynare.org/t/rank-condition-not-satisfied/6136>\
**Category:** Dynare help (legacy posts)\
**Created:** [11 April 2017 13:53 UTC](https://forum.dynare.org/t/rank-condition-not-satisfied/6136 "2017-04-11T13:53:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![econik16](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/d6d6ee/32.png) [@econik16](https://forum.dynare.org/u/econik16)\
**Post date:** [11 April 2017 13:53 UTC](https://forum.dynare.org/t/rank-condition-not-satisfied/6136/1 "2017-04-11T13:53:45Z")

</div>

Hi,

I’m sorry to be asking this question, because there are so many threads covering this topic, but I’m having a rank condition problem, and having looked through all the threads, I still can’t figure out what the problem with my code is.

I have a simple NK mode, without K or wage rigidities. I have a much larger model that I want to work with, but as always advised, started with the simplest form. However even with this the rank condition is not satisfied. The model as it is gives the following error:

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

and when I run a model\_diagnostics, I get told that Lambda isn’t present at current value, which is true, since Lambda only appears as Lambda(+1). But the rank problem doesn’t change when I only use Lambda (well now I only have 4 forward-looking vars, but still a rank condition issue).

Lambda is the stochastic discount factor of the HH. I need it as it’s needed in my bigger model. But I have also tried to add a lambda in the dynare code which is the lagrangian (so lambda = 1/C), and calculate Lambda from that, or even completely replace Lambda. But none of these solve the problem. I have tried to change the timing of R as well, and again, no avail.

Would greatly appreciate some help.  
[steady\_stateNS.m](https://forum.dynare.org/uploads/default/original/2X/6/6b1b1e01ba6ccccdf4de3cb23e56b52077b9793e.m) (1.09 KB)  
[nk.mod](https://forum.dynare.org/uploads/default/original/2X/5/52b7567539d85008c94f38b4f8dd9eced05e133d.mod) (4.72 KB)  
[main.m](https://forum.dynare.org/uploads/default/original/2X/8/85ae9f2aacb7edd016cd2aa55f395fae0f03468f.m) (2.03 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:** [11 April 2017 18:28 UTC](https://forum.dynare.org/t/rank-condition-not-satisfied/6136/2 "2017-04-11T18:28:24Z")

</div>

What is the intuition of

`1/R = Lambda(+1)/Pi(+1); % (2) EE in bond market
beta*C = Lambda(+1)*C(+1); % (3) Stochastic discount rate of stockholders
`  
Usually, the Euler equation should read

```auto

```

But that is not what you implement.

---

<div class="post-metadata">

**Author:** ![econik16](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/d6d6ee/32.png) [@econik16](https://forum.dynare.org/u/econik16)\
**Post date:** [12 April 2017 10:50 UTC](https://forum.dynare.org/t/rank-condition-not-satisfied/6136/3 "2017-04-12T10:50:36Z")

</div>

Hi,

That’s just the step before getting the euler equation. The EE is reached by combining the FOC wrt bonds with FOC wrt consumption that gives lambda = u’© which is = 1/C in this case (I have log utility). So instead of doing the combination I just left it in the first stage, and just replace beta\*lambda(+1)/lambda by Lambda(+1), which is the stochastic discount factor of the households.

This doesn’t make any difference in my problem, as what you wrote is basically what I have with Lambda(+1) substituted. I actually just ran it with your EE and get the same error.

---

<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:** [12 April 2017 11:26 UTC](https://forum.dynare.org/t/rank-condition-not-satisfied/6136/4 "2017-04-12T11:26:28Z")

</div>

Please use the Euler equation I provided, get rid of Lambda and check the exponents of Pi in the Gammas as well as the law of motion for price dispersion. Please refer to [github.com/JohannesPfeifer/DSGE\_mod/blob/master/Gali\_2015/Gali\_2015\_chapter\_3\_nonlinear.mod](https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Gali_2015/Gali_2015_chapter_3_nonlinear.mod)
