Hi Prof. Pfeifer,
I have a flexible price open economy DSGE model that I want to transform to include price stickness and monetary policy. After adjusting the model equations, I get the following error: Floating point error in bytecode: a/X with X=0.
Could you please help me understand the cause for the error and how to debug.
Here is the original code:
Equations_orig.mod (13.0 KB)
and here is the modified version with sticky price and monetary policy:
Equations_modified.mod (16.5 KB).
Thank you for your help
You did only provide the model equations, not a full code that can be run.
Here is the model with sticky price and monetary policy:
NK Model.zip (2.1 MB)
The original model can be accessed through this link: Carbon pricing, border adjustment and climate clubs: Options for international cooperation - ScienceDirect. Beside the fatal floating error, I also noticed that dynare created auxiliary variables for capital making the number of equations higher than number of variables even though I declared capital as predetermined and there are no lags higher than 1 in the Model. Thanks!
With that zip file, what do I need to do to generate the error message?
Please run the file Main.m which is the main matlab file that run and solve the model. The code is attached. Thanks.
NK Model.zip (2.1 MB)
The full message was
Floating point error in bytecode: a/X with X=0
equation 3792
residual(3792) = (pi_ppi_1_a_t / pi_ppi_2_a_t) - ((PC_1_a_t / PC_2_a_t) * (PC_2_a_t / PC_1_a_t))
You can verify that the initial value for pi_ppi_2_a_t
is 0, resulting in the division by 0.
In Dynare with the attached files, you will not get a crash, but a message that the steady state could not be found:
NK Model_6.zip (2.1 MB)
- That message should not appear in Dynare 6. Are you sure you correctly switched the version?
- For a model that size, I can only recommend to either simplify or compute the steady state analytically. That would also provide an important cross-check between equations and steady state.