Dynare example files not working

Hi! I’m using Matlab R2022a and dynare 5.1 version now.
I’m learning how to enter an external steady state m file.
So I was trying to run dynare example files with an external steady state m file such as example 3, and NK_baseline, but It didn’t work on my computer.
I checked the path of the files and it doesn’t have any problem.
Is it because of my version of dynare?
When I run NK_baseline.mod file, the error message says:

Warning: Some of the parameters have no value (gammma1, Rbar, Lambdax, LambdaYd) 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.
Warning: Identifier ‘delta’ in the evaluated statement does not refer to the external function. In a
future release, using an identifier different to how it is used in the file will not be supported.

In NK_baseline_steadystate (line 39)
In evaluate_steady_state_file (line 49)
In evaluate_steady_state (line 254)
In steady_ (line 55)
In steady (line 80)
In NK_baseline.driver (line 452)
In dynare (line 281)
Check for incorrect argument data type or missing argument in call to function ‘isShapeOnXY’.
Error in - (line 858)
if ~isShapeOnXY(poly1)||~isShapeOnXY(poly2)
Error in NK_baseline_steadystate (line 66)
gammma1=mu_z*mu_I/betta-(1-delta);
Error in evaluate_steady_state_file (line 49)
[ys,params1,check] = h_steadystate(ys_init, exo_ss,M,options);
Error in evaluate_steady_state (line 254)
[ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, options,steadystate_check_flag);
Error in steady_ (line 55)
[steady_state,params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);
Error in steady (line 80)
[oo_.steady_state,M_.params,info] = steady_(M_,options_,oo_);
Error in NK_baseline.driver (line 452)
steady;
Error in dynare (line 281)
evalin(‘base’,[fname ‘.driver’]);

I attached the relevant files, Can anyone help me? Please.

Thanks in advance!

example3_steady_state_helper.m (374 Bytes)
NK_baseline.mod (10.6 KB)
NK_baseline_steadystate.m (4.7 KB)
example3.mod (2.7 KB)

seems to belong to a class shape. See Parallel pool on AWS needs files attached - MATLAB Answers - MATLAB Central

So there must be some weird path conflict be going on on your machine that I cannot replicate on mine.

Hello, Professor!
Thank you for the reply.
in my 5.1 dynare example folder, the only NK_baseline.mod is not working.
so I put NK_baseline.mod and steady state m file on the another folder, and the warning “Check for incorrect argument data type or missing argument in call to function ‘isShapeOnXY’.” disapeared.
but still show up an error like:

Warning: Some of the parameters have no value (gammma1, Rbar, Lambdax, LambdaYd) 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.
Error using NK_baseline_steadystate
Too many input arguments.
Error in evaluate_steady_state_file (line 49)
[ys,params1,check] = h_steadystate(ys_init, exo_ss,M,options);
Error in evaluate_steady_state (line 254)
[ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, options,steadystate_check_flag);
Error in steady_ (line 55)
[steady_state,params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);
Error in steady (line 80)
[oo_.steady_state,M_.params,info] = steady_(M_,options_,oo_);
Error in NK_baseline.driver (line 452)
steady;
Error in dynare (line 281)
evalin(‘base’,[fname ‘.driver’]);

I checked the previous Q&A in Dynare Forum, I think my problem is the same as the below question, but I don’t know how to figure it out. should I download another version of dynare??
Can you please tell me what should I do for running this file properly?

The new error message suggests that you are working with a steady state file written for Dynare 4.5, not the one for Dynare 5.1.

Dear Professor, Thank you for your prompt response!
as you suggested that I downloaded Dynare 4.5 and tried to run it, but still have the same error message.
I was working with a Dynare 4.5 example file with the exact same Dynare 4.5.
I have no idea…but many thanks!

If the header looks like

function [ys,params,check] = NK_baseline_steadystate(ys,exo,M_,options_)

it’s the version for Dynare 4.6 and higher.

Thank you for giving me advice again Professor!
I’ve tried to delete all the versions of Dynare and only reinstalled Dynare 4.6,
and even I redownloaded the files here: examples/NK_baseline_steadystate.m · 4.6 · Dynare / dynare · GitLab
but It didn’t work at all.
That’s weird…
Professor, is it working well on your machine?
I may need to just have a look at how those external steady-state files enter and try my best to make mine.

Thanks again, Professor!

Can you please provide the log-file that is created when you try to run the file.

Hello, Professor!
Here is my log-file and the file I downloaded from the dynare GitHub(I slightly changed the file name, but the contents are the same.)
NK_baseline1.log (2.7 KB)

and I have one more question.
this is my code and the problem with finding a steady state.

NK_olg2.mod (3.6 KB)

I’ve got this errer messege:

Warning: Some of the parameters have no value (crss, hrss, nrss, epsilonss, thetass, cwss, hwss, omss, nwss,
nss, Yss, arrss, awss, css, F1ss, F2ss, hss) 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... 
Randomize initial guess...




Residuals of the static equations:

Equation number 1 : 11.157 : 1
Equation number 2 : 7.2232 : 2
Equation number 3 : 13.9513 : 3
Equation number 4 : 0.69341 : 4
Equation number 5 : 12.0029 : 5
Equation number 6 : -0.36093 : 6
Equation number 7 : -4.7634 : 7
Equation number 8 : 1.43 : 8
Equation number 9 : 29.2086 : 9
Equation number 10 : 4.3819 : 10
Equation number 11 : -25.6047 : 11
Equation number 12 : -38.2961 : 12
Equation number 13 : 24.2533 : 13
Equation number 14 : -7.6634 : 14
Equation number 15 : 0.9986 : 15
Equation number 16 : -15.9138 : 16
Equation number 17 : -38.0645 : 17
Equation number 18 : -3.7934 : 18
Equation number 19 : 0.15844 : 19
Equation number 20 : 10.2795 : 20
Equation number 21 : -17.1845 : 21
Equation number 22 : 7.7255 : 22
Equation number 23 : 0.23017 : 23
Equation number 24 : -14.5003 : 24
Equation number 25 : 8.3681 : 25
Equation number 26 : 30.557 : 26
Equation number 27 : -24.5847 : 27
Equation number 28 : -26.2695 : 28


Error using print_info
Impossible to find the steady state (the sum of square residuals of the static equations is 8868.9814). Either
the model doesn't have a steady state, there are an infinity of steady states, or the guess values are too far
from the solution
Error in steady (line 102)
    print_info(info,options_.noprint, options_);
Error in NK_olg2.driver (line 516)
steady;
Error in dynare (line 293)
evalin('base',[fname '.driver']) ; 

I think it’s because some of my parameters are not initialized especially lines 39,40,41.
I tried to figure out these three equations and three variables with a pencil and paper, but I couldn’t calculate them. so my question is, in this case, do I need to make an external steadystate.m file?(if so could you please tell me how to use fsolve, I’ve been searched this problem for so long, this is all I guess about solving the problem)
or are there any other solutions to figure out using one mod file with dynare?

many thanks, prof. Pfeifer!

  1. Now you are using Dynare 4.6 but with an older steady state file.
  2. omss is used before it is defined. Follow Debugging parameter initializations and steady_state_model-blocks - YouTube for debugging.

Thanks for your answer, prof. Pfeifer!
now I can solve the NK_baseline file problem.
and for the second problem, I’ve already watched your youtube clip before I asked,
but my problem is if I put ‘omss’ before ‘thetass’ and ‘epsilons’, it also not works well,
because the equation ‘omss’ includes a variable ‘epsilonss’ which hasn’t been defined yet if I put omss befor epsilonss.

thetass=1-(Rss*omss)^(rho/(1-rho))beta^(1/(1-rho));
epsilonss=(1-gamma
Rss^(rho/(1-rho))*beta^1/(1-rho))/thetass;
omss=omega+(1-omega)epsilonss^((rho-1)/rho)(1/xi)^(1/(1-nu));

Can you please tell me any solutions for this?

Best regards,
Jisu

It seems you have a simultaneous equation system. You need to solve that manually.

1 Like

Thanks agin. Professor Pfeifer.
Yes, it is.
Could you please more specifically tell me how I need to solve this ‘manually’? I’m still learning Dynare, so don’t know what should I do right now.
Please.

This is not about Dynare. You linearized by hand and need to provide the values for the coefficients (steady states of the nonlinearized model). You need to obtain them in closed form or use numerical techniques to obtain their values by solving the equation system.

Thanks for your help.
If you don’t mind could you please give me a reference related to numerical techniques that I can follow?
I’ve searched for it, but still, I don’t get it that much.
Really thank you a lot for the precious help!

You need to solve the system

thetass=1-(Rss*omss)^(rho/(1-rho))beta^(1/(1-rho));
epsilonss=(1-gammaRss^(rho/(1-rho))*beta^1/(1-rho))/thetass;
omss=omega+(1-omega)epsilonss^((rho-1)/rho)(1/xi)^(1/(1-nu));

which is three equations in three unknowns. You can try that by hand or use Matlab’s fsolve.

Now I get it!
Thanks a lot, professor Pfeifer!
your advice helps me a lot!