Steady-state-model block

Dear all,

I have got a question concerning the steady-state-model block. I’ve calculated the steady-state closed-form solutions of some variables by hand and others by using a Matlab helper function. I stored all steady-state values of the variables in the Matlab workspace (pls. see image attached). Now, I want to paste these steady-state values into the steady-state-model block. My initial approach, however, does not work and Dynare returns an error message:

ERROR: in the ‘steady_state_model’ block, variable ‘z_steady’ is undefined in the declaration of variable ‘z’

Error using dynare (line 282)
Dynare: preprocessing failed

How can I solve this issue?

After specifying the steady_state_model block, I added the Matlab file to my mod file:

// steady-state block

@#include “SteadyState.m”

Huge thanks in advance!

Hi mat1339,

you also have to tell Dynare to load the steady state values and when you already have them calculated you can also just use them as initial values. Save them as for instance stst.mat in Matlab and then before the initval block load them with load stst.mat; This should do it.

Then you get something like

load stst.mat;
z = z_steady;
r = r_steady;

Hi DoubleBass,

thank you very much for this workaround!

I’ve read somewhere that the steady-state-model block is more efficient in terms of computation time in the estimation part. Do I loose this gain in efficiency when I specify the steady-state-values in the initval block?


True, it should of course also work with the steady state block. Just thought that you might want to use initval since you calculated some of the values numerically and there could be some errors. You can just try both methods and observe what works better or faster for you.

Hi DoubleBass,

thanks again!

I’ve just tried to specify “load stst.mat” in front of the steady_state_model block. Unfortunately, the error message does not disappear. Do you may have another idea how I can cope with this?

Thanks so much!

Does it work with initval? To check myself I would need the mod and stst.mat files.

Could you provide the files?

Yes, it does work with the initval block.

Attached you’ll find the files as an example.
Declarations.m (986 Bytes)
params.mat (847 Bytes)
SteadyState.m (619 Bytes)
stst.mat (1.0 KB)
Test.mod (763 Bytes)

Thank you!

I meant you should also post the file that creates the stst.mat

You also have to declare the steady states as parameters, this is why Dynare did not know what z_steady was for instance.

Declarations.m (1.8 KB)
Test.mod (1.0 KB)

Thank you very much!