Hello Prof. I am new to Dynare and DSGE. I am attempting to replicate a paper by Fève, Moura and Pierrard for Indian economy. As written a in paper I am trying to run bayesian estimation of DSGE RBC Model. But I am getting persistent error of the steady state has NaNs or Inf. I am unable to figure out why this is so. Kindly help me out. I am attaching the relevant paper, my mod file and data file respectively.

Paper.pdf (2 MB)

DSGEM.mod (3.5 KB)

DSGE.csv (1.0 KB)

I am gettting following results:

Residuals of the static equations:

Equation number 1 : NaN : y

Equation number 2 : NaN : rk

Equation number 3 : NaN : w

Equation number 4 : NaN : pc

Equation number 5 : NaN : x

Equation number 6 : NaN : cc

Equation number 7 : NaN : 7

Equation number 8 : NaN : 8

Equation number 9 : NaN : 9

Equation number 10 : NaN : t

Equation number 11 : NaN : 11

Equation number 12 : NaN : 12

Equation number 13 : NaN : 13

Equation number 14 : NaN : z

Equation number 15 : 0 : g

Equation number 16 : NaN : 16

Equation number 17 : NaN : sh

Equation number 18 : NaN : le

Equation number 19 : NaN : sp

Equation number 20 : NaN : 20

Equation number 21 : NaN : eps_l

Equation number 22 : NaN : eps_a

Equation number 23 : NaN : 23

Equation number 24 : NaN : 24

Equation number 25 : NaN : 25

error: The steady state has NaNs or Inf.

error: called from

print_info at line 32 column 5

steady at line 102 column 5

driver at line 554 column 1

dynare at line 281 column 5

Hi Siddharth,

first of all, you should start with making your model run for stochastic simulation before you try to estimate it. Second, as Dynare tells you, you did not give numbers to all the parameters that you defined, which causes problems. Then, when sequentially calculating parameters that depend on each other you have to be able to one-by-one go through them and get numbers. This is a simple check if you have missed something.

In your case for example:

`sp_bar = rk_bar - 0.025;`

The parameter rk_bar is defined two lines below.

`y_bar = eps_z_bar*((k_bar)^(1-alph))*(h_bar)^alph;`

The parameter eps_z_bar is not defined at all.

1 Like

Thank you so much sir for your quick reply. I will do the suggested amendments and see if it works.

I have written a code for simulation. Mod file is attached here. I am getting an error saying invalid left hand side of assignment

```
1 +((theta1)*(theta2)*(-1-eta))/(1+(theta2)*(n-eta*(n+d-ab))) = o*(1+rd);
^
error: called from
dynare at line 281 column 5
```

Kindly guide me where am I going wrong?

SimulDSGE.mod (2.4 KB)

You are using a nonlinear model but do not declare a steady state. You are either supposed to add a steady state model or give initial values for your steady state to let Dynare solve it. If you do not add that Dynare assumes zero as an initial value for all endogenous variables when solving for the steady state, which often breaks stuff.

1 Like

SimulDSGE1.mod (2.2 KB)

After adding initval, although I got rid of previous error but now I am getting the following error;

```
Residuals of the static equations:
Equation number 1 : NaN : k
Equation number 2 : NaN : y
Equation number 3 : NaN : rk
Equation number 4 : NaN : w
Equation number 5 : NaN : 5
Equation number 6 : NaN : 6
Equation number 7 : NaN : g
Equation number 8 : NaN : 8
Equation number 9 : NaN : x
Equation number 10 : NaN : b
Equation number 11 : NaN : 11
Equation number 12 : NaN : 12
Equation number 13 : NaN : 13
Equation number 14 : NaN : t
Equation number 15 : NaN : 15
Equation number 16 : NaN : z
Equation number 17 : NaN : 17
Equation number 18 : NaN : 18
Equation number 19 : NaN : o
Equation number 20 : NaN : q
Equation number 21 : NaN : 21
Equation number 22 : NaN : 22
Equation number 23 : NaN : sh
Equation number 24 : NaN : le
Equation number 25 : NaN : sp
Equation number 26 : NaN : 26
Equation number 27 : NaN : el
Equation number 28 : NaN : ea
Equation number 29 : NaN : 29
Equation number 30 : NaN : 30
Equation number 31 : NaN : 31
error: The steady state has NaNs or Inf.
error: called from
print_info at line 32 column 5
steady at line 102 column 5
driver at line 462 column 1
dynare at line 281 column 5
```

Kindly help me out

Dynare tells you what is wrong:

```
Warning: Some of the parameters have no value (rdss, xss, less, qss, abss, lss, rass) when using steady. If these parameters are not
initialized in a steadystate file or a steady_state_model-block, Dynare may not be able to solve the model. Note that simul,
perfect_foresight_setup, and perfect_foresight_solver do not automatically call the steady state file.
```

You should set values for all parameters that you define.

DSGEM.mod (4.3 KB)

I have done all the suggested changes and now I am getting an error saying;

error: The steadystate file did not compute the steady state

error: called from

print_info at line 32 column 5

steady at line 102 column 5

driver at line 585 column 1

dynare at line 281 column 5

Kindly guide me through

I do not understand the file fully. You declare some parameters multiple times like y_bar that you for instance declare three times in the parameter section with different values. That cannot be.

Further, you are using a steady_state_model block. This means that you have to declare the exact steady state there that solves the model, otherwise you get the error that you mentioned.

So maybe that causes the issue.

DSGEM.mod (4.3 KB)

I have removed the aforementioned points. I am getting an error saying;

error: Blanchard & Kahn conditions are not satisfied: indeterminacy.;

Kindly help

Your steady_state_model block does not calculate the actual steady state. If you remove the (nocheck) option from the steady command it will tell you that it does not work. If you use a steady_state_model block it has to actually calculate the model’s steady state, ie you have to be able to analytically solve for it.

1 Like