Debt Dynamics with Stochastic Shocks

Problem Statement: Debt Dynamics with Stochastic Shocks

Objective:
Analyze the debt-to-GDP ratio of a country over time under stochastic (random) variations in interest rates $(r_t)$ and GDP growth rates $(g_t)$.

This captures the uncertainty in economic conditions and provides insights into debt sustainability in a volatile environment.


Model

The debt-to-GDP ratio evolves as:
$$
b_{t+1} = b_t \cdot \frac{1 + r_t}{1 + g_t} - p
$$

  • $b_t$: Debt-to-GDP ratio at time $t$.
  • $r_t$: Random interest rate at $t$, drawn from a normal distribution.
  • $g_t$: Random GDP growth rate at $t$, drawn from a normal distribution.
  • $p$: Primary balance as a percentage of GDP ($p > 0$ for surplus, $p < 0$ for deficit).

The randomness in $r_t$ and $g_t$ represents economic uncertainties, such as financial market shocks or unexpected GDP contractions.


Python Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import numpy as np
import matplotlib.pyplot as plt

# Parameters
T = 50 # Time horizon (years)
b0 = 0.8 # Initial debt-to-GDP ratio
p = -0.02 # Primary deficit (-2% of GDP)

# Stochastic parameters
mean_r = 0.03 # Mean interest rate (3%)
std_r = 0.01 # Standard deviation of interest rate
mean_g = 0.02 # Mean GDP growth rate (2%)
std_g = 0.015 # Standard deviation of GDP growth rate

# Simulation
np.random.seed(42) # For reproducibility
r_t = np.random.normal(mean_r, std_r, T) # Random interest rates
g_t = np.random.normal(mean_g, std_g, T) # Random GDP growth rates

time = np.arange(T)
debt_to_gdp = np.zeros(T)
debt_to_gdp[0] = b0

for t in range(1, T):
debt_to_gdp[t] = debt_to_gdp[t-1] * ((1 + r_t[t]) / (1 + g_t[t])) - p

# Visualization
plt.figure(figsize=(12, 6))

# Debt-to-GDP Ratio Over Time
plt.plot(time, debt_to_gdp, label="Debt-to-GDP Ratio", color="blue")
plt.axhline(1, color="black", linestyle="--", alpha=0.7, label="100% Debt-to-GDP")
plt.fill_between(time, 0, debt_to_gdp, color="blue", alpha=0.2)
plt.title("Debt-to-GDP Dynamics with Stochastic Shocks")
plt.xlabel("Time (Years)")
plt.ylabel("Debt-to-GDP Ratio")
plt.legend()
plt.grid()
plt.tight_layout()
plt.show()

# Summary
print(f"Initial Debt-to-GDP Ratio: {b0:.2f}")
print(f"Debt-to-GDP Ratio After {T} Years: {debt_to_gdp[-1]:.2f}")
print(f"Average Interest Rate: {np.mean(r_t):.2%}")
print(f"Average GDP Growth Rate: {np.mean(g_t):.2%}")

Explanation of Code

  1. Stochastic Variables:

    • The interest rate $(r_t)$ and GDP growth rate $(g_t)$ are drawn from normal distributions with specified means and standard deviations.
    • This randomness models real-world economic uncertainties.
  2. Debt Evolution:

    • At each time step, the debt-to-GDP ratio evolves based on the stochastic parameters.
  3. Visualization:

    • The debt-to-GDP trajectory shows the impact of economic volatility.
    • The shaded region emphasizes the fluctuation over time.

Results

Initial Debt-to-GDP Ratio: 0.80
Debt-to-GDP Ratio After 50 Years: 2.31
Average Interest Rate: 2.77%
Average GDP Growth Rate: 2.03%
  1. Debt Path:

    • The debt-to-GDP ratio fluctuates due to variations in interest rates and GDP growth rates.
    • Persistent high interest rates or low growth can lead to unsustainable debt.
  2. Long-Term Trend:

    • The final debt-to-GDP ratio depends on the cumulative effect of the stochastic shocks.
  3. Policy Implications:

    • Governments should account for uncertainty when setting fiscal targets.
    • Debt sustainability requires managing both expected trends and risks.