Questions about graphing results from perfect_foresight solver and how to handle steady states

I am trying to graph my model’s transition path between the initial and end point.
One thing I want to point out is that my model is somewhat unconventional in the sense that the D_t is chosen in the beginning of the period and D_t+1 is determined at the very end of the period as a new variable “- saving” which will not be carried over to the next period but just stored away in this toy model. Also, in my model, eta is the shock variable.

I have 2 questions:

  1. I want to set the graph to ignore such small differences and just show a number upto 4 digits below decimal point; For example, I want to draw a graph of lambda with the y-axis values showing 1.14 instead of all the decimal points of 5e-16 or such. Would you please shed some light for me on what I need to do to make this happen?

  2. For certain variables, specifically q and investment variables, they are forced to jump back down at the end of the period for any given initial value. I believe it’s because I set the endval block to be at the steady state. However, I shouldn’t have such graph with such enforcement back to the steady state. What I want is to either 1) find the appropriate initial point which will let me land on to the end steady state value after the shock, or 2) start from a given initial point then end at the corresponding end point instead of forcing to end at the steady state. I tried the 2) case but still was not able to make it happen. Would you please be able to help me find a way to do this?

If you have any other related comments or concerns with this coding, I would greatly appreciate it if you would share those with me.

Thank you so much in advance for you time and help.

Calibration_SYL_ver28.mod (2.9 KB)

  1. You can set explicit ylim. See Set or query y-axis limits - MATLAB ylim - MathWorks Deutschland
  2. You are not using enough periods for the system to transition back to steady state. Use

You may then only plot the subset that interests you, e.g. setting xlim([0 30]).

Hello Prof. Pfeifer,

Thank you so much for your reply and I’m grateful for your help and advice.
That solved my problems just fine and works fine on those points.

However, I have another issue in the coding.
I specified the endval values. But my Dynare simulation result is ignoring such values at the last period of the simulation and comes out with different numbers. The simulation is not ending at the specified endval values I put in. Would you please help me out on this?

I would greatly appreciate it if you would help me out with this issue.
Thank you so much in advance for your time and help.
Calibration_SYL_ver33_2.mod (2.5 KB)

Where can I see this? I see a jump in the last period.

Hello Prof. Pfeifer,

When I checked on oo_.endo_simul for corresponding variable values, I could see that the simulation end values are not matching with my specified end point. For example, in the code, I specified my endval for investment to be 1938.246. However, on the simulation end value, it shows 205.136. And the same issue for other variables.
So, I’m thinking something is not working as I want it to be, but I couldn’t figure it out on my own.

Thank you so much in advance for your time and help.

This seems to be a bug. See Fix or document interaction of steady_state_model-block and initval and endval (#1866) · Issues · Dynare / dynare · GitLab

Thank you so much for your help

Hello Prof. Pfeifer,

I have been trying to fix the issue but now the code tells me that it can’t find any steady state at all now.

I thought it was due to some initval or parameter values. However, since I can’t arbitrarily choose my parameters and endval as I based them on my calibrated values, I don’t know how to fix this issue. Ironically, at least to me, introducing steady_state_model block makes it work for the same parameter and endval values specified. Would you please help me resolve this steady state issue? I am trying to make the code work in the sense that moves from specified initval to specified endval showing its simulated transition graph.
(It seems like without fixing steady state issue, Dynare wouldn’t work at all to me)

Here I attached my revised code which are not working now due to steady state issue.

Thank you so much for your help and I really appreciate your help.
Calibration_SYL_ver33_3.mod (2.6 KB)

Please use the most recent unstable version together with a steady_state_model-block. The bug has been fixed there and we will release Dynare 5.3 soon. At the same time, I think there is still a problem in your setup. The terminal value typically needs to be a proper steady state, not an arbitrary value. That seems to be the problem with your model.

Dear Prof. Pfeifer,

Thank you so much for your reply.
However, is there a way to fix this problem without changing my endval? I want to show transition path differing based on the initval but still ending at the same endval. Since endval is derived from my data, I would like to stick to the endval I specified here. In my previous code named “Calibration_SYL_ver33_3.mod”, the initval has several examples which are derived from either the data, or steady state value from my theoretical model. However, none of the examples for initval worked due to steady state issue. Are there any other possibilities that stopped this code other than endval and parameters?

Thank you so much for your help.

You cannot simply have the model end at an arbitrary point in the state space. That’s the root cause of the issue. How would you force agents to end up there? The buggy Dynare version ironed this out by setting a terminal steady state when it recognized the presence of a steady state file.