3 Stochastic Simulation

StocasticTrajectories_simulate.py is used for simulating paths with shock term.

StocasticTrajectories_plot.py plots figures using stochastic paths. We will show how each part of code plot what figures.

Simulation Variables Summary

State Variables

  • ``states`` (hist): An array containing the simulated paths of the state variables over time. Each state includes:

    • ``K``: Log of capital stock \(\log K_t\).

    • ``Y``: Temperature anomaly \(Y_t\).

    • ``L``: Log of technology level \(\log R_t\).

Control Variables

  • ``i``: Investment \(i^k_t\) in levels, representing the amount of investment over time.

  • ``e``: Emission \(\mathcal{E}_t\), representing emissions over time.

  • ``x``: R&D investment \(i^r_t\) in levels.

Economic Variables

  • ``c``: Consumption over time, computed based on output, investment, and R&D expenditures.

\[C_t = \alpha K_t \left (1 - \phi_0\left(A^b_t\right)^{\phi_1} \right) - I_t^k - I_t^r\]
  • ``dmg``: Damage function over time, representing the impact of temperature anomaly on the economy.

\[N_t= e^{ \lambda_1 + \lambda_2 y_t }\]

Social Cost Variables

  • ``scc``: Social Cost of Carbon (SCC) \(\frac{\partial \hat{V}}{\partial e }\) over time, representing the marginal cost of carbon emissions.

  • ``scrd``: Social Cost of R&D \(\frac{\partial \hat{V}}{\partial r}\), representing the marginal value of R&D investments.

  • ``scgw``: Social Cost of Global Warming \(\frac{\partial \hat{V}}{\partial y}\), representing the cost associated with temperature anomalies.

Value Functions

  • ``vt``: Value function \(\hat{V}\) over time before technology jump.

  • ``v_post_techt``: Value function \(\hat{V}^L\) over time after technology jump.

Adjustment Functions

  • ``ht``: Uncertainty adjustment \(h_y\) for temperature anomaly.

  • ``hkt``: Uncertainty adjustment \(h_k\) for capital.

  • ``hjt``: Uncertainty adjustment \(h_r\) for knowledge capital.

  • ``gt_dmg``: Damage jump probability adjustments \(g^\ell\) over time for different damage models.

  • ``gt_tech``: Technology jump probability adjustment \(f^L\) over time.

Probability Variables

  • ``distorted_damage_prob``: Distorted probability of damage jumps over time \(J^\ell \cdot g^\ell\).

  • ``distorted_tech_prob``: Distorted probability of technology jumps over time \(J^L \cdot f^L\).

  • ``true_tech_prob``: True probability of technology jumps over time \(J^\ell\).

  • ``true_damage_prob``: True probability of damage jumps over time \(J^L\).

  • ``TA``: Temperature anomaly \(Y_t\) over time.

Relative Entropy Variables

  • ``RelativeEntropy_hk``: Relative entropy related to capital uncertainty adjustment.

\[\frac{1}{2} \times \xi_k \times h_k^2\]
  • ``RelativeEntropy_hY``: Relative entropy related to temperature anomaly uncertainty adjustment.

\[\frac{1}{2} \times \xi_c \times h_t^2\]
  • ``RelativeEntropy_hj``: Relative entropy related to knowledge capital uncertainty adjustment.

\[\frac{1}{2} \times \xi_j \times h_j^2\]
  • ``RelativeEntropy_TechJump``: Relative entropy related to technology jumps.

\[\xi_j \times J^L \left(1 - f + f \times \log(f)\right)\]
  • ``RelativeEntropy_DamageJump``: Relative entropy related to damage jumps.

\[\xi_d \times \sum_\ell J^\ell \left(1 - g^\ell + g^\ell \times \log(g^\ell)\right)\]

3.1 Sample Simulation

from src.plot import plot_simulated_stoc_path_full2_selected

plot_simulated_stoc_path_full2_selected("RD_Plot", "Figure 22: R&D Investment as Percentage of GDP","%", [0,10])
plot_simulated_stoc_path_full2_selected("e", """Figure 23: Simulated Pathways of Emissions""","", [6,25])
plot_simulated_stoc_path_full2_selected("LogSVRD_Plot", """Figure 24: Simulated Pathways of the Social Value of R&D  <br> Exponential of vertical axis gives economic value in units of consumption""","", [4,10])
plot_simulated_stoc_path_full2_selected("LogSCGW_Plot", """Figure 25: Simulated Pathways of the Social Cost of Global Warming  <br> Exponential of vertical axis gives economic value in units of consumption""","", [6,14])
plot_simulated_stoc_path_full2_selected("TA", """Figure 26: Simulated Pathways of Temperature Anomaly""","", [0,3])

Distorted technology jump probability is calculated by line 536 in ZeroShockTrajectories_simulate.py. It follows equation

\[1-{\widetilde E}\left[ \exp\left( - \int_0^t \left[ {\mathcal J}^{L}(X_u) g^{L*}(X_u) \right]du \right)\mid X_0 = x\right].\]
plot_simulated_stoc_path_full2_selected("distorted_tech_prob", "Figure 27: Distorted Probability of a Technology Change Jump","", [0,1])

Distorted damage jump probability is caculated in line 543. It follows below equation

\[1- {\widetilde E}\left[ \exp\left( - \int_0^t \left[ \sum_{\ell=1}^{L-1} {\mathcal J}^{\ell}(X_u) g^{\ell*}(X_u) \right]du \right)\mid X_0 = x\right]\]
plot_simulated_stoc_path_full2_selected("distorted_damage_prob", "Figure 28: Distorted Probability of a Damage Jump","", [0,1])
plot_simulated_stoc_path_full2_selected("gamma3", "Figure 29: Damage Realization","", [0,1/3])

3.2 Stochastic Simulation with More Pathways

from src.plot import plot_simulated_stoc_path_full2_split2


plot_simulated_stoc_path_full2_split2("RD_Plot", "Figure 30: R&D Investment as Percentage of GDP","%",
                                      [0,10])
plot_simulated_stoc_path_full2_split2("e", """Figure 31: Simulated Pathways of Emissions""","", [6,25])
plot_simulated_stoc_path_full2_split2("LogSVRD_Plot", """Figure 32: Simulated Pathways of the Social Value of R&D  <br> Exponential of vertical axis gives economic value in units of consumption""","", [6,25])
plot_simulated_stoc_path_full2_split2("LogSCGW_Plot", """Figure 33: Simulated Pathways of the Social Cost of Global Warming  <br> Exponential of vertical axis gives economic value in units of consumption""","", [6,14])
plot_simulated_stoc_path_full2_split2("TA", """Figure 34: Simulated Pathways of Temperature Anomaly""","", [0,3])
plot_simulated_stoc_path_full2_split2("distorted_tech_prob", "Figure 35: Distorted Probability of a Technology Change Jump","", [0,1])
plot_simulated_stoc_path_full2_split2("distorted_damage_prob", "Figure 36: Distorted Probability of a Damage Jump","", [0,1])
plot_simulated_stoc_path_full2_split2("gamma3", "Figure 37: Damage Realization","", [0,1/3])