In the code above, a smooth transition is observed. In my results, on the other hand, the transition path stabilizes and then suddenly spikes up and drops at the end. Why does this happen, and how can I make the path smoother?

Thank you professor. I really appreciate your help.

However, I got same problem although I increase the periods to 1000.
The model_diagnostics gives no obvious problems.
It seems 1000 periods are enough but I still got the same problem. Could you please help me with this?

Here’s my new code which has been modified little bit.
(I remove variable ‘price level P’ as the previous mod file has singularity problem) example.mod (6.6 KB)

Why does it need to be set as eps_tau? In your example, DSGE_mod/Solow_model/Solow_SS_transition.mod at master · JohannesPfeifer/DSGE_mod · GitHub, you set different values for the endogenous variable k in initval and endval, and used that to achieve perfect foresight. Referring to this example, I also set the value of the endogenous variable TAU to 0 in initval and 0.3 in endval. What is the difference that makes my code incorrect?

I followed your suggestion and set eps_tau. In this case, I think the steady; command should be placed after both initval and endval. Is that correct? However, I could not obtain the appropriate transition path. I believe I set the initial and terminal conditions correctly. Could you please help me resolve this issue?

Steady states are always conditional on the values of the exogenous variables. You are trying to set an endogenous object TAU directly to a value that is inconsistent with the value of the underlying exogenous variable eps_tau. The example you refer to is not applicable in your case because it does not have exogenous variables. Also the example does a steady state transition by setting the initial value of a state variable.

Using

rplot TAU Y S;

suggests the simulation works and the transition to the new steady state is immediate due to non-existent endogenous propagation.

Thank you professor.
I updated my model and use perfect foresight solver to get transitions from the initial steady state to the new one, which comes from the permanent tax shock.
The perfect foresight solution found, and I get the transitions of the variables.

I have two questions.

From the model_diagnostics, I get following messages:

MODEL_DIAGNOSTICS: The Jacobian of the static model is singular
MODEL_DIAGNOSTICS: there is 1 collinear relationships between the variables and the equations
Collinear variables:
U
Z
Collinear equations
14 16

The variable U is ‘abatement effort’ and Z is ‘Emissions’ in my environmental model. I have no clue why there is collinear relationship between those variables and I cannot find the redundant equations. Is this a problem although I get the perfect solution?

Also, I get some warning messages as below.

Warning: Matrix is singular to working precision.
In sim1>lin_solve (line 189)
In sim1 (line 131)
In perfect_foresight_solver_core (line 103)
In perfect_foresight_solver>homotopy_loop (line 357)
In perfect_foresight_solver (line 153)
In example2.driver (line 599)
In dynare (line 310)

But after the warning messages, Dynare goes into the homotopy iterations and then the solutions are found. Is this a problem to deal with?

Both warnings are not a big issue. The collinearity warning seems to be spurious. It is gone as soon as you move the model_diagnostics command after the initval or endval statements.

The singularity warning indicates a problem in solving the model. But homotopy still finds a solution.

Professor, sorry to bother you again but I got another question.

Now I extend my model to two sector model, sector d and o, and I want to impose permanent shock to only sector d.
I used initval; and endval; command as in the last (one-sector) model.
The thing is, I could find the both old and new steady state, but the perfect foresight solver failed unlike in the one-sector model. So I cannot get the transition path.

As I just extend my one-sector model to two-sector, I cannot find what is wrong with my code file.
Could you please help me with this? Thank you as always.

If you run the check command, you will get an error message

The generalized Schur (QZ) decomposition failed. For more information, see the documentation for Lapack function dgges: info=19, n=17. You
can also run model_diagnostics to get more information on what may cause this problem.

There must be a fundamental singularity in your model.

Many thanks for your response. That means I need to work on my model equations.

I have some follow-up questions:

In my previous one-sector model, I was able to find the perfect foresight solution. However, when I run the check command in this code, I also get the following error message:

Error using print_info (line 33)
The generalized Schur (QZ) decomposition failed. For more
information, see the documentation for Lapack function dgges: info=11, n=9.
You can also run model_diagnostics to get more information on what may cause
this problem.

More specifically, I receive the error message when I place the check command immediately after the model;, steady_state_model;, and initval; blocks. When I run the check command after the endval; block, I do not receive any error message. (This is the same as the model_diagnostics command I asked about earlier.) Does this indicate that my one-sector model also has a singularity problem? I am asking this question to start from the one-sector model if there is a singularity issue.

Could you please let me know where to find the information about Lapack function dgges: info=11, n=9?

Do you have any idea what brings the singularity in my model? Could it be that the issue is caused by not putting the tax shock in log form? or the Calvo pricing?

Here’s my code file of one-sector model.
I really appreciate your help.

involves 0 derivatives on both sides due to TAUd and Ud being 0. That may be the cause of the issue. That’s not necessarily a problem if you shock the system and the local stability conditions are satisfied at subsequent points. However, when I put check after endval I get

There are 9 eigenvalue(s) larger than 1 in modulus for 10 forward-looking variable(s)
The rank condition ISN'T verified!

That may be the actual issue. Why should the simulation converge to that point?
2. There is not really a lot of information on that. It’s information on singularity/ill-conditioned matrices. See the comment in LAPACK: SRC/dgges.f Source File
3. As pointed out above, it seems to be the one condition.