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

Hello,
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
perfect_foresight_setup(periods=300);

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