Hello forum!
I am trying to replicate the analysis in Sahuc, Smets, Vermandel (2024) “The New Keynesian Climate model”. It is a nonlinear model that features deterministic trend processes and environmental damage. It is solved in the paper using the extended path solution method.
In my model.mod file I am encountering collinearity issues that, in my understanding, cause the perfect foresicht solver in the extended path to fail.
The static model does not have residuals and a numerical steady state, which the model is supposed to converge to in the long-run, can be computed.
I am unsure where the collinearity issues stem from. The model equations should in principle be sufficient to describe the dynamics. I would appreciate any hint at what could be causing the problems.
I attached my .mod file. I also attached a function file get_z_alt.m, which computes an asymptotic value for technology z and the carbon stock m in the long-run using the trend processes.
Thank you in advance!
Best, Maurice
get_z_alt.m (1.9 KB)
NKCM.mod (28.3 KB)
Given the unit roots in the model, the collinearity warning is expected. I would be more worried about the massive scale differences between variables like
m_tilde 2432.01
tau_tilde 3.98107e-07
The carbon stock m_tilde is indeed much larger in terms of st st convergence value compared to other variables, but it is also initialized as a large value in the first place and is build up via emissions each peridod over the long horizon. tau_tilde as the tax scale variable on the other hand is supposed to converge to close to zero. In my understanding, these large differences are to be expected.
How would these scale differences impact the extended path?
When I run an extended path, each iteration shows warning “err. = Inf, time = 0.009 Warning: Matrix is singular to working precision.”
For now, focus getting a regular perfect foresight simulation to run. Your model does not have a proper initial condition. Because you only set endval
, the initial condition is all 0, which is infeasible for l
for example.
I report back with progress, and a new issue!
Thank you Johannes for the tip, this got the ball roling.
I am now at the point where I can run perfect foresight and extended path setups in multiple contexts (deterministic, stochastic and using forward guidance). The model is however numerically too unstable beyond around 750 periods, that is one concern.
In the new package attached you’ll find NKCM_model.mod containing the model, NKCM_simulations.mod containing simulation instructions as well as a Matlab Script NKCM_workflow.mlx with a script for calculating different carbon transition scenarios.
Before running perfect foresight projections under different carbon tax regimes, I calculate a stochastic baseline path for the variables up until 2023. The second-to-last quarter from this (155) is then fed into the transition scenarios as the initial steady state from which to simulate from.
My question: In the first few periods of the transition, there should still be some influence from the shocks of the stochastic path slowly converging back to 1, since i pass their last values (eps_b etc.) as an initial condition. However, all shock AR1-processes are immediately 1 as soon as the transition starts.
I believe this is why my results, while fundamentally reasonable in terms of direction, are way off in terms of magnitude.
Is this related to the specification of initval and edval?
Also could you maybe comment on the numerical instability beyond 750 periods?
Thank you in advance!
NKCM_model.mod (33.6 KB)
NKCM_simulations.mod (3.7 KB)
get_z_alt.m (2.4 KB)
Workflow.m (22.5 KB)
It seems the tau_exo_tax_matrix.mat
is missing.
Sorry for that oversight, here the tau_exo matrix file.
tau_exo_tax_matrix.mat (2.2 KB)
Take your process
eps_b = (1-rho_b) + rho_b * eps_b(-1) + eta_b;
This equation implies that eps_b=1
in steady state, which is the initial value you set.