# Some variables are missing

**URL:** https://forum.dynare.org/t/some-variables-are-missing/12651
**Category:** Estimation
**Created:** [23 October 2018 07:09 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651 "2018-10-23T07:09:44Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [23 October 2018 07:09 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/1 "2018-10-23T07:09:44Z")

</div>

Hello,

I am new to using Bayesian estimation techniques and this is my first attempt at estimating with Dynare. It seems that in the estimation command Dynare is not reading the data file. I have made sure that the variables in the data file are the same as in varobs.  
I get the following error:

You did not declare endogenous variables after the estimation/calib\_smoother command.  
Prior distribution for parameter betta has unbounded density!

Error using load\_m\_file\_data\_legacy (line 52)  
Some variables are missing (PI c g or y)!  
Error in makedataset (line 125)  
DynareDataset = load\_m\_file\_data\_legacy(datafile, DynareOptions.varobs);

[Sentiment2.mod](https://forum.dynare.org/uploads/default/original/2X/8/8cbb59aed8128fe33775f1d35f20d30eee68b06e.mod) (5.2 KB)  
[Sentiment2\_steadystate.m](https://forum.dynare.org/uploads/default/original/2X/c/cc6cce8f2b24063c53ca3d0c9dc0bf08609aa061.m) (1.9 KB)  
[data\_Sentiment2.m](https://forum.dynare.org/uploads/default/original/2X/9/96a739f1c3de7ec4f36418274c2447eaf50bca26.m) (3.6 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: [23 October 2018 07:56 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/2 "2018-10-23T07:56:22Z")

</div>

You declared

> [@mohsen](#):
>
> PI c g or y

as observed, but your dataset only contains

PI\_obs c\_obs and so on.

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [23 October 2018 09:55 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/3 "2018-10-23T09:55:00Z")

</div>

I fixed the problems, but again this error appears:

You did not declare endogenous variables after the estimation/calib\_smoother command.  
Prior distribution for parameter betta has unbounded density!

dynare\_estimation\_init:: The steady state at the initial parameters cannot be computed.  
Error using print\_info (line 76)  
The steadystate file did not compute the steady state

[Sentiment2\_steadystate.m](https://forum.dynare.org/uploads/default/original/2X/c/cc6cce8f2b24063c53ca3d0c9dc0bf08609aa061.m) (1.9 KB)  
[Sentiment2.mod](https://forum.dynare.org/uploads/default/original/2X/2/241375d4a6fccec5b0f6a4b0ab6cbd67ed8192b6.mod) (5.2 KB)  
[data\_Sentiment2.m](https://forum.dynare.org/uploads/default/original/2X/c/c80dfef3357cc9cedc8b93792d6b3f3a66776de9.m) (3.6 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: [23 October 2018 10:37 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/4 "2018-10-23T10:37:50Z")

</div>

Your steady state file is still wrong. For the initial parameters:

```auto
Residuals of the static equations:

Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : 0
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : 0
Equation number 8 : 0
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : 0
Equation number 12 : 0
Equation number 13 : 0.1789
Equation number 14 : 0
Equation number 15 : 0
Equation number 16 : 0
Equation number 17 : 0
Equation number 18 : 0
Equation number 19 : 0

```

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [23 October 2018 12:07 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/5 "2018-10-23T12:07:11Z")

</div>

How did you get this result? This is different to my calculations. I get the following error.

dynare\_estimation\_init:: The steady state at the initial parameters cannot be computed.  
Error using print\_info (line 76)  
The steadystate file did not compute the steady state

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [23 October 2018 12:15 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/6 "2018-10-23T12:15:47Z")

</div>

Of course, I find this error during estimation and it is not in stochastic simulation. why?

---

<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 October 2018 12:28 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/7 "2018-10-23T12:28:23Z")

</div>

After the crash, I typed  
`steady`  
into the Matlab command window. What this suggests is that your steady state file does not solve the static model for arbitrary parameter sets. It works for the calibration you selected for `stoch_simul`, but not for the prior mean.

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [23 October 2018 16:25 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/8 "2018-10-23T16:25:36Z")

</div>

For that residuals of the static equations to be zero, the sum of rhomb and lambdaPI should be equal to one (rhomb +lambdaPI =1). I applied this condition to the amount of these parameters in stochastic simulation, but did not work in the estimation? Why? Or how can I apply it?

---

<div class="post-metadata">

### Author: ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)
#### Post date: [23 October 2018 16:39 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/9 "2018-10-23T16:39:53Z")

</div>

Hi,

I do not know the model and do not understand the nature of the constraint you are taking about (I suspect something is wrong in the model). But if you have this kind of hard constraint on the parameters, you cannot estimate both parameters. You have to pick one parameter for estimation, and deduce the other one wit the constraint.

Best,  
Stéphane.

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [23 October 2018 18:09 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/10 "2018-10-23T18:09:50Z")

</div>

I tried to apply this restriction but I encountered the following error:

Error in computing likelihood for initial parameter values  
Error using print\_info (line 42)  
Blanchard Kahn conditions are not satisfied: no stable equilibrium

Error in print\_info (line 42)  
error([‘Blanchard Kahn conditions are not satisfied: no stable’ …

Can you guide?  
[Sentiment2.mod](https://forum.dynare.org/uploads/default/original/2X/5/56eacbeb842e518aecf94dca6421356270301073.mod) (5.3 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: [24 October 2018 12:41 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/11 "2018-10-24T12:41:06Z")

</div>

1. Your model has a unit root, so you require the `diffuse_filter`-option.
2. After that, you will get a stochastic singularity error. Search the forum on this.
3. Are you sure your steady state makes sense? Consumption in steady state is 29561.2, n=8972.76

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [1 November 2018 17:36 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/12 "2018-11-01T17:36:41Z")

</div>

> [@jpfeifer](#):
>
> stochastic singularity

Hello. The stochastic singularity problem was solved by deleting the observations, but after executing model\_diagnostics, the following message is received:

MODEL\_DIAGNOSTICS: The following endogenous variables aren’t present at the current period in the model:  
k  
MODEL\_DIAGNOSTICS: The Jacobian of the static model is singular  
MODEL\_DIAGNOSTICS: there is 1 colinear relationships between the variables and the equations  
Colinear variables:  
c  
mc  
i  
PI  
x  
w  
y  
n  
k  
m  
mb  
fr  
ndf  
dc  
AUX\_ENDO\_LAG\_11\_1  
Colinear equations  
13 14

MODEL\_DIAGNOSTICS: The singularity seems to be (partly) caused by the presence of a unit root  
MODEL\_DIAGNOSTICS: as the absolute value of one eigenvalue is in the range of ±1e-6 to 1.  
MODEL\_DIAGNOSTICS: If the model is actually supposed to feature unit root behavior, such a warning is expected,  
MODEL\_DIAGNOSTICS: but you should nevertheless check whether there is an additional singularity problem.  
MODEL\_DIAGNOSTICS: The presence of a singularity problem typically indicates that there is one  
MODEL\_DIAGNOSTICS: redundant equation entered in the model block, while another non-redundant equation  
MODEL\_DIAGNOSTICS: is missing. The problem often derives from Walras Law.

[Sentiment2.mod](https://forum.dynare.org/uploads/default/original/2X/8/89d2e23351218c77632b3eeb824a44f8fbb32e47.mod) (5.4 KB)  
[Sentiment2\_steadystate.m](https://forum.dynare.org/uploads/default/original/2X/b/bd2be6aeefc653f72a306ab5fef4a5ffe6824c4d.m) (1.9 KB)

How do I find colinear relationships between the variables and the equations? which variables or equations? Is my model’s problem?

---

<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: [2 November 2018 08:00 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/13 "2018-11-02T08:00:47Z")

</div>

The most important issue is

```auto
MODEL_DIAGNOSTICS: The following endogenous variables aren’t present at the current period in the model:
k

```

Thus, you must have a timing problem.

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [7 November 2018 07:06 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/14 "2018-11-07T07:06:29Z")

</div>

Hi, I get the message mentioned above when I use the equation k=x+(1-delta)\*k(-1),  
but when I use the equation k(+1)=x+(1-delta)\*k, I get the following message: Blanchard Kahn conditions are not satisfied: indeterminacy .  
I think the second equation is correct, but how do I meet Blanchard-kahn’s condition? I still not sure how to fix the attached code after reading the forum archives.  
[Sentiment2.mod](https://forum.dynare.org/uploads/default/original/2X/1/132facea3cde2e23c30a68cbdbb2aae4d26447fa.mod) (5.5 KB)  
[Sentiment2\_steadystate.m](https://forum.dynare.org/uploads/default/original/2X/b/bd2be6aeefc653f72a306ab5fef4a5ffe6824c4d.m) (1.9 KB)

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [10 November 2018 06:37 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/15 "2018-11-10T06:37:10Z")

</div>

Hello, can anyone help me?

---

<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: [10 November 2018 07:50 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/16 "2018-11-10T07:50:19Z")

</div>

You are using the `predetermined_variables`-command for `k`, so the beg`inning of period stock notation

```auto
k(+1)=x+(1-delta)*k

```

is the correct one. That the BK conditions are then not satisfied suggests that there is still a different timing problem.

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [10 November 2018 11:39 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/17 "2018-11-10T11:39:07Z")

</div>

I solved the timing problem, but still remains following warning:

MODEL\_DIAGNOSTICS: The Jacobian of the static model is singular  
MODEL\_DIAGNOSTICS: there is 1 colinear relationships between the variables and the equations  
Colinear variables:  
c  
mc  
i  
PI  
x  
w  
y  
n  
k  
m  
mb  
fr  
ndf  
dc  
Colinear equations  
13 14

MODEL\_DIAGNOSTICS: The singularity seems to be (partly) caused by the presence of a unit root  
MODEL\_DIAGNOSTICS: as the absolute value of one eigenvalue is in the range of ±1e-6 to 1.  
MODEL\_DIAGNOSTICS: If the model is actually supposed to feature unit root behavior, such a warning is expected,  
MODEL\_DIAGNOSTICS: but you should nevertheless check whether there is an additional singularity problem.  
MODEL\_DIAGNOSTICS: The presence of a singularity problem typically indicates that there is one  
MODEL\_DIAGNOSTICS: redundant equation entered in the model block, while another non-redundant equation  
MODEL\_DIAGNOSTICS: is missing. The problem often derives from Walras Law.

[Sentiment2.mod](https://forum.dynare.org/uploads/default/original/2X/1/1d8e7ceb27aa9a6e184a9da910d2a920a54831b0.mod) (5.5 KB)  
[Sentiment2\_steadystate.m](https://forum.dynare.org/uploads/default/original/2X/b/bd2be6aeefc653f72a306ab5fef4a5ffe6824c4d.m) (1.9 KB)  
How do I find colinear relationships between the variables and the equations? which variables or equations? Is my model’s problem?

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [11 November 2018 09:24 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/18 "2018-11-11T09:24:41Z")

</div>

Is it possible that this warning Caused from equations 10, 11, and 12?

---

<div class="post-metadata">

### Author: ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)
#### Post date: [12 November 2018 07:31 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/19 "2018-11-12T07:31:21Z")

</div>

Or may be from the equality PI = mb in steady state, has arisen?

---

<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 November 2018 10:12 UTC](https://forum.dynare.org/t/some-variables-are-missing/12651/20 "2018-11-12T10:12:34Z")

</div>

Your exogenous process might be causing this. You have a money growth rule, so the nominal money stock is not stationary. It may be that in some equations you still rely on this nominal money stock instead on the stationary real one.

[Next page](https://forum.dynare.org/t/some-variables-are-missing/12651.md?page=2)
