Computing the steady-state

Dear all,

I am having some difficulties solving my model, or computing the steady state of it that is, due to wrong initial values I assume. I have tried several alternatives of solve algo and homotopy:

//tried option 1-5
steady (solve_algo = 5 );

//also tried homotopy in addition
homotopy_setup;
sigma, 0.5, 2;
ua, 5;
end;

steady (homotopy_mode = 1, homotopy_steps=50);

Using homotopy I get the following error message in Matlab:

STEADY: numerical initial values incompatible with the following equations
1 2 3 4 6 9 11 12 14 16 18 21

??? Error using ==> dynare_solve
exiting …

Error in ==> steady_ at 124
[oo_.steady_state,check] = dynare_solve([M_.fname ‘_static’],…

Error in ==> steady at 52
steady_;

Error in ==> model_1 at 228
steady;

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

I have attached my mod-file below, I am thankful for all suggestions. In case there shouldn’t be some way to solve the model in dynare, does anyone maybe have an example file on how to compute the steady outside of dynare in matlab?

Thank you
Fontana

have you tried simplifying the model to see if you can get a steady state? That is, maybe cut some of the variables, then add them in one by one to see when it fails. To be honest, your model is too big for me to have time to look hard at it.

Dear Ian,

thanks for your help. I was really hoping I could avoid doing that this time. I am currently trying to do it variable by variable. Let’s see which one causes the problem.

Fontana

Hi fontana,
I’ve the same problem. Have you found a solution?
Best regard
Moh

Not yet, I have started from a working mod-file and put in the equations and variables step by step. I ll keep you posted

Hi everyone,

so this took a while, sorry about the delay. I have consctructed a working model, which however lacks several exponents here and there. I have been trying to add the missing variables and parameters, which was unsuccesful however.

Would it be necessary to change the ‘model(linear)’ option? Which solving algorithm for the steady state would be appropriate?

I am thankful for any suggestions.

Thank you
Fontana

Hello everyone,

I am also currently trying to compute the steady state in a separate m-file (based on the m-file by Stephan Adjeman-like my predecessor in the earlier post, I am also not familiar with the intricacies of the process), however I get the following error message:

??? Error: File: model1_steadystate.m Line: 36 Column: 38
The expression to the left of the equals sign is not a valid target for an assignment.

I am thankful for any suggestions. What exactly are the requirements for entering the equations into the m-file. I simply copied them exactly the way they are from the mod-file, I assume this must be the mistake, but I am not sure how else to enter them???

Thank you and best regards
Fontana

The problem lies at line 36 of model1_steadystate.m

You cannot say MATLAB something like that:

a+b=c;

Because in MATLAB the equal sign is the operator assignment. So MATLAB doesn’t know which value to assign to which variable.

In the _steadystate file, you don’t write equations like you do in the MOD file: you explictly resolve your steady state by recursively assigning values to the endogenous.

Best

Dear Sébastien,

thank you, I do understand. Now that you have said it, I am realising that Stephan’s steadystate file was built exactly that way.

I do have a problem however solving my equations recursively because of all the interdependencies between them. Do you think it makes sense to try to solve it recursively considering its size or is there a way to solve for the steady state inside of dynare?

Thank you for your help,
Fontana

Hi,

If you can’t solve it recursively, you can isolate a small subset of variables for which you need a numerical solver, and run that numerical solver from inside the _steadystate file.

Otherwise if you drop the _steadystate.m file, you can use the solver embedded inside Dynare.

Best

Thanks Sébastien,

problem is, solving it inside of Dynare did not work very well, I assume because of wrong initial values. I am getting the following error code:

STEADY: numerical initial values incompatible with the following equations
1 2 3 4 6 9 11 12 14 16 18

??? Error using ==> dynare_solve
exiting …

Error in ==> steady_ at 124
[oo_.steady_state,check] = dynare_solve([M_.fname ‘_static’],…

Error in ==> steady at 52
steady_;

Error in ==> model1 at 202
steady;

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

Like I said, I was able to make the reduced version below work, but I am not able to add anymore parameters or variables to that one. I have also tried the other solving algorithms and get similar error messages.

Best regards,
Fontana

Hi everyone,

since my previous error message referred to wrong initial values, I entered initial values for all endogenous variables (including lots of trial and error) and achieved a spurios convergence. After an attempt to compute the steady state I am getting the following error message:

SOLVE: Iteration 351
Spurious convergence.
12.3717
1.4895
-0.6533
0.4720
-53.0689
2.3885
1.9117
6.8042
3.4604
-0.0000
1.1705
0.2329
0.3715
1.0000
0
0.1956
0.5420
0.1675
-0.0000
-6.4897
1.0000
0.0100

??? Error using ==> steady_
STEADY: convergence problems

Error in ==> steady at 52
steady_;

Error in ==> model1 at 238
steady;

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

I have attached the mod-file below. Any ideas why it is giving me this error message?

Thank you for your help,
Fontana

Hi,

You should use the instruction “resid(1)” (before “steady;”) to identify which equation fail to hold. In ur case, only equation 8 has a residual equal to 0. You need to check ur initial values. Plus, as your model is non linear, u better remove the option “linear” in the block model.

Hope this helps,

Best

Thank you Assia,

I have added ‘resid(1)’ before the steady command and you are right, only one equation had a residual of 0. (I have deleted the linear option, thank you).

If I am understanding the ‘resid(1)’ command correctly, it calculates, the difference that is left, using the given initial values. Do I need to get zero for all euqations or are values close to zero also acceptable to compute the steady state?

By the way, I have seen/heard of possibilites to solve for the steady state of my model using mathematica. Would this be an alternative?

Thank you for your help,
Fontana

Hi,

well, it can happen that Dynare computes the steady-state while you have non-zero residuals on certain equations, but generally they r pretty close to 0. Yet to avoid potential issues, that’s better to choose initial guesses that will give u 0 residuals.

Regarding the Mathematica option, sure that’s a possibility. You can also solve for the steady-state by hand when the model isn’t too big.

Best