Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Epidemic-Economic Integrated Models

“The pandemic created an externality that standard macroeconomic models cannot capture: your consumption decision imposes infection risk on others. That externality is the source of the market failure.” — Martin Eichenbaum, Sergio Rebelo, and Mathias Trabandt

Cross-reference: Principles Ch. 41 (COVID-19: SIR dynamics, lockdowns, CARES Act, vaccination) [P:Ch.41]


38.1 The Epidemiological-Economic Integration Problem

The COVID-19 pandemic forced macroeconomists to confront a phenomenon with no precedent in the DSGE toolkit: an infectious disease externality. Standard macroeconomic shocks — technology, demand, monetary — are transmitted through prices and interest rates. An epidemic is transmitted through physical contact: each economic transaction (going to work, shopping, socializing) carries an infection risk that the individual does not fully internalize.

This creates a specific type of market failure: contagion externality. Each agent, when choosing how much to work and consume, does not account for the infection risk they impose on others. The competitive equilibrium is inefficient: too much activity early in the epidemic, too little investment in isolation, and suboptimal timing of the return to normal activity.

The Eichenbaum–Rebelo–Trabandt (ERT, 2021) model addresses this by embedding a SIR epidemiological model inside a DSGE framework. The household’s Euler equation is modified to account for infection risk, and the social planner’s problem is solved via the Hamiltonian machinery of Chapter 11.


38.2 The SIR Model

The Susceptible–Infectious–Recovered (SIR) model (Kermack and McKendrick, 1927) is the foundational epidemiological compartmental model.

Definition 38.1 (SIR Model). At each date tt, the population is divided into three compartments:

  • StS_t: Susceptible — can contract the disease.

  • ItI_t: Infectious — currently infected and contagious.

  • RtR_t: Recovered/Removed — immune or deceased.

With St+It+Rt=1S_t + I_t + R_t = 1 (normalized population), the dynamics:

S˙t=βepiStIt,I˙t=βepiStItγIt,R˙t=γIt.\dot{S}_t = -\beta^{epi} S_t I_t, \qquad \dot{I}_t = \beta^{epi} S_t I_t - \gamma I_t, \qquad \dot{R}_t = \gamma I_t.

Definition 38.2 (Basic Reproduction Number). The basic reproduction number R0=βepi/γ\mathcal{R}_0 = \beta^{epi}/\gamma is the expected number of secondary infections generated by one infectious individual in a fully susceptible population. The epidemic grows (I˙>0\dot{I} > 0) iff R0St>1\mathcal{R}_0 S_t > 1.

Theorem 38.1 (Herd Immunity Threshold). The epidemic peaks when St=1/R0S_t = 1/\mathcal{R}_0. The herd immunity threshold (the fraction that must be immune to stop growth) is:

HIT=11R0.HIT = 1 - \frac{1}{\mathcal{R}_0}.

Proof. The epidemic peaks when I˙=0\dot{I} = 0: βepiStItγIt=0St=γ/βepi=1/R0\beta^{epi}S_tI_t - \gamma I_t = 0 \Rightarrow S_t = \gamma/\beta^{epi} = 1/\mathcal{R}_0. The HIT is 1Speak=11/R01 - S^{peak} = 1 - 1/\mathcal{R}_0. \square

For COVID-19: R02.5\mathcal{R}_0 \approx 2.5 (original strain), giving HIT60%HIT \approx 60\%. For the Delta variant: R06\mathcal{R}_0 \approx 67, HIT83HIT \approx 8386%86\%.


38.3 The ERT Model: Coupling SIR to DSGE

Household preferences. The representative susceptible household maximizes expected lifetime utility, where the utility function accounts for infection risk:

u(Ct,Nt)=lnCtNt1+ϕ1+ϕ,u(C_t, N_t) = \ln C_t - \frac{N_t^{1+\phi}}{1+\phi},

subject to the budget constraint and the infection probability that depends on economic activity.

Infection technology. The probability that a susceptible household becomes infected depends on its own consumption CtC_t and labor NtN_t, and on the aggregate infection rate ItI_t:

πtinfection=πCCtIt+πNNtIt+πotherIt,\pi_t^{infection} = \pi^C C_t I_t + \pi^N N_t I_t + \pi^{other} I_t,

where πC,πN,πother\pi^C, \pi^N, \pi^{other} are transmission rates from consumption contacts, work contacts, and other contacts. This specification makes infection endogenous to economic choices — a key departure from exogenous epidemiological models.

Modified SIR dynamics:

S˙t=(πCCt+πNNt+πother)ItSt,\dot{S}_t = -(\pi^C C_t + \pi^N N_t + \pi^{other})I_t S_t,
I˙t=(πCCt+πNNt+πother)ItStγIt.\dot{I}_t = (\pi^C C_t + \pi^N N_t + \pi^{other})I_t S_t - \gamma I_t.

The effective transmission rate βtepi=πCCt+πNNt+πother\beta^{epi}_t = \pi^C C_t + \pi^N N_t + \pi^{other} is now endogenous — it falls when households voluntarily reduce activity.


38.4 The Modified Household Euler Equation

The household faces an intertemporal optimization problem where infection risk enters the value function. For a susceptible household:

VS(at)=maxCt,Nt{u(Ct,Nt)+eρΔt[(1πt)VS(at+1)+πtVI(at+1)]},V^S(a_t) = \max_{C_t, N_t}\left\{u(C_t, N_t) + e^{-\rho\Delta t}\left[(1-\pi_t)V^S(a_{t+1}) + \pi_t V^I(a_{t+1})\right]\right\},

where πt\pi_t is the infection probability and VIV^I is the value of being infected (lower, due to illness costs).

The modified Euler equation for susceptible households:

uC(Ct)=eρ ⁣[(1πt)VCS(at+1)+πtVCI(at+1)+infection externality correction].u_C(C_t) = e^{-\rho}\!\left[(1-\pi_t)V^S_C(a_{t+1}) + \pi_t V^I_C(a_{t+1}) + \text{infection externality correction}\right].

The key modification: the household partially internalizes the cost of infection but does not internalize the infection risk imposed on others. This creates the externality.

The contagion externality. The social planner solves the same problem but includes the effect of each household’s activity on the aggregate infection rate ItI_t:

Externality=πaggregateCt(value loss from infecting others).\text{Externality} = \frac{\partial\pi^{aggregate}}{\partial C_t}\cdot(\text{value loss from infecting others}).

The externality is negative (more activity imposes more infection risk on the susceptible population) and grows with ItI_t (more infectious people → higher external cost of activity).


38.5 The Optimal Lockdown Hamiltonian

The social planner’s optimal lockdown problem is a continuous-time optimal control problem:

max{Ct,Nt}0eρt[Stu(Ct,Nt)+ItuI(CtI,NtI)+Rtu(CtR,NtR)]dt\max_{\{C_t, N_t\}}\int_0^\infty e^{-\rho t}\left[S_t u(C_t, N_t) + I_t u^I(C_t^I, N_t^I) + R_t u(C_t^R, N_t^R)\right]dt

subject to SIR dynamics with endogenous transmission.

The Hamiltonian:

H=Su+IuI+RuR+λSS˙+λII˙+λRR˙,\mathcal{H} = S\cdot u + I\cdot u^I + R\cdot u^R + \lambda^S\dot{S} + \lambda^I\dot{I} + \lambda^R\dot{R},

where λS\lambda^S, λI\lambda^I, λR\lambda^R are the costate variables (shadow values of the susceptible, infected, and recovered populations).

Theorem 38.2 (Optimal Lockdown Condition). The social planner’s optimality condition for consumption:

uC(Ct)=λtSπCIt(St1)internalized infection cost+eρE[VCS]standard Euler,u_C(C_t) = \underbrace{\lambda^S_t\cdot\pi^C I_t (S_t - 1)}_{\text{internalized infection cost}} + \underbrace{e^{-\rho}\mathbb{E}[V^S_C]}_{\text{standard Euler}},

where the additional term captures the cost of infecting others through consumption contacts. The social planner’s optimal consumption is lower than the competitive equilibrium whenever It>0I_t > 0 — the optimal lockdown is an internalization of the contagion externality.

Derivation. The costate equation for λS\lambda^S: λ˙S=ρλSH/S\dot\lambda^S = \rho\lambda^S - \partial\mathcal{H}/\partial S. The FOC for CtC_t: H/C=0\partial\mathcal{H}/\partial C = 0, giving StuC(Ct)+λS(πCItSt)+λI(πCItSt)=0S_tu_C(C_t) + \lambda^S(-\pi^C I_t S_t) + \lambda^I(\pi^C I_t S_t) = 0, so the shadow benefit of consumption (SuCSu_C) equals the net shadow cost of infection spread λSλI\lambda^S - \lambda^I times the contact rate. \square


38.6 Numerical Solution of the ERT Model

The ERT model is solved as a two-point boundary value problem: initial conditions fix (S0,I0,R0)(S_0, I_0, R_0) (epidemiological state at pandemic onset), while a terminal condition (herd immunity or vaccine arrival) fixes the endpoint.

Algorithm 38.1 (ERT Solution).

  1. Discretize time into periods of 1 week (or 1 day for precision).

  2. At the optimal lockdown, the household’s FOC pins (Ct,Nt)(C_t, N_t) as functions of the state (St,It)(S_t, I_t) and costate (λtS,λtI)(\lambda^S_t, \lambda^I_t).

  3. The costate equations λ˙S,λ˙I\dot\lambda^S, \dot\lambda^I provide the costate dynamics.

  4. The system (S,I,R,λS,λI)(S, I, R, \lambda^S, \lambda^I) is solved by the shooting method: guess λ0S\lambda^S_0, integrate forward, adjust until the terminal condition is satisfied.

Python

import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt

# ERT model parameters
rho   = 0.04/52     # weekly discount rate (4% annual)
gamma = 0.2         # recovery rate (5-week infectious period)
pi_C  = 0.5e-4      # transmission per consumption contact
pi_N  = 0.5e-4      # transmission per work contact  
pi_0  = 0.1e-4      # background transmission
phi_labor = 2.0     # inverse Frisch elasticity
kappa_ill = 0.1     # utility loss from illness

def ert_system(t, state, lockdown_level=1.0):
    """ERT model ODEs for social planner."""
    S, I, R, lam_S, lam_I = state
    
    # Effective transmission (reduced by lockdown)
    C_t = lockdown_level * 0.8   # consumption relative to normal
    N_t = lockdown_level * 0.9   # labor relative to normal
    beta_t = (pi_C * C_t + pi_N * N_t + pi_0)
    
    # SIR dynamics
    new_infections = beta_t * S * I
    dS = -new_infections
    dI =  new_infections - gamma * I
    dR =  gamma * I
    
    # Costate equations (simplified: lam = value loss from infection)
    dlam_S =  rho * lam_S + beta_t * I * (lam_S - lam_I)
    dlam_I = (rho + gamma) * lam_I - kappa_ill - beta_t * S * (lam_S - lam_I)
    
    return [dS, dI, dR, dlam_S, dlam_I]

def solve_ert(lockdown_level=1.0, T_weeks=104):
    """Solve ERT model for given lockdown intensity."""
    # COVID-19 calibration (approximate)
    S0 = 0.999; I0 = 0.001; R0 = 0.0
    lam_S0 = -0.5; lam_I0 = -1.0  # initial costate guesses
    y0 = [S0, I0, R0, lam_S0, lam_I0]
    
    sol = solve_ivp(lambda t,y: ert_system(t, y, lockdown_level),
                    [0, T_weeks], y0, max_step=0.5, dense_output=True)
    return sol

# Compare: no lockdown vs. optimal lockdown vs. strict lockdown
fig, axes = plt.subplots(2, 2, figsize=(12, 8))
labels = ['S (susceptible)', 'I (infected, %)', 'R (recovered)', 'GDP (relative)']
lockdowns = [(1.0, 'No lockdown'), (0.7, 'Moderate (30% reduction)'), (0.5, 'Strict (50% reduction)')]

for ld, name in lockdowns:
    sol = solve_ert(lockdown_level=ld)
    t = sol.t; S,I,R = sol.y[0], sol.y[1], sol.y[2]
    GDP = ld * np.ones_like(t) * (1 - 0.5*I)  # GDP drops with infection rate too
    
    for ax, (data, label) in zip(axes.flat, [(S, 'S'), (I*100, 'I%'), (R, 'R'), (GDP, 'GDP')]):
        ax.plot(t, {'S':S,'I%':I*100,'R':R,'GDP':GDP}[label], label=name)

for ax, label in zip(axes.flat, labels):
    ax.set_title(label); ax.set_xlabel('Weeks'); ax.legend(fontsize=8)
plt.suptitle('ERT Model: SIR-Economic Coupling')
plt.tight_layout(); plt.show()

# Compute R0 and herd immunity threshold
R0 = (pi_C*0.8 + pi_N*0.9 + pi_0) / gamma
HIT = 1 - 1/R0
print(f"\nCOVID calibration:")
print(f"  R₀ ≈ {R0:.2f}  (data: 2-3 for original strain)")
print(f"  HIT ≈ {HIT*100:.1f}%  (data: ~60% for R₀=2.5)")
print(f"  Peak infection share (no lockdown): {sol_no_ld.y[1].max()*100:.1f}%")

Julia

using DifferentialEquations, Statistics

# Julia: SIR model with optimal lockdown
function sir_ode!(du, u, p, t)
    S, I, R = u; beta, gamma = p
    new_inf = beta * S * I
    du[1] = -new_inf; du[2] = new_inf - gamma*I; du[3] = gamma*I
end

# Calibration for COVID-19 (original strain)
R0_covid = 2.5; gamma = 0.2  # 1/5 weeks recovery
beta_base = R0_covid * gamma
HIT = 1 - 1/R0_covid
println("COVID-19 SIR calibration:")
println("  R₀ = $R0_covid, HIT = $(round(HIT*100,digits=1))%")

# Solve without any lockdown
u0 = [0.999, 0.001, 0.0]
prob = ODEProblem(sir_ode!, u0, (0.0, 104.0), [beta_base, gamma])
sol = solve(prob, Tsit5(), saveat=1.0)
peak_I = maximum(sol[2,:])
println("  Peak infected (no lockdown): $(round(peak_I*100,digits=2))%")
println("  Total infected (no lockdown): $(round((1-sol[1,end])*100,digits=1))%")

# With 30% behavior reduction
beta_ld = beta_base * 0.7
prob_ld = ODEProblem(sir_ode!, u0, (0.0, 104.0), [beta_ld, gamma])
sol_ld = solve(prob_ld, Tsit5(), saveat=1.0)
println("  Peak infected (30% lockdown): $(round(maximum(sol_ld[2,:])*100,digits=2))%")

38.7 Policy Experiments

38.7.1 Optimal Lockdown Timing

The optimal lockdown depends critically on the stage of the epidemic. Too early: wastes economic damage before the epidemic has spread widely. Too late: allows exponential growth that requires much more severe restrictions later.

The ERT model shows the optimal lockdown begins when the infection rate exceeds a threshold II^* determined by the costate equation:

IuC(C)(λSλI)πCS,I^* \approx \frac{u_C(C^*)}{(\lambda^S - \lambda^I)\cdot\pi^C\cdot S^*},

at which point the marginal cost of infection externality equals the marginal utility of consumption.

38.7.2 Vaccine Rollout

When a vaccine arrives at date TVT_V with coverage ν\nu (fraction vaccinated), the effective SS drops to (1ν)STV(1-\nu)S_{T_V}. If ν>HIT\nu > HIT, herd immunity is achieved and the epidemic ends. Optimal vaccine rollout prioritizes the most active (high-contact) individuals — workers in customer-facing industries — rather than the most at-risk (elderly), balancing epidemiological effectiveness with distributional equity.

38.7.3 Fiscal Stimulus

The CARES Act (\approx$2 trillion) provided direct payments to households and expanded unemployment insurance. In the ERT model, direct payments increase consumption — which increases transmission if It>0I_t > 0. The optimal fiscal response targets consumption that has low transmission risk (home food delivery rather than restaurant meals) while supporting incomes.


38.8 Programming Exercises

Exercise 38.1 (APL — SIR Simulation)

Implement the SIR model in APL as a scan: {sir_step ⍵}\ T ⍴ ⊂(S0, I0, R0). (a) Simulate 100 weeks with R0=2.5\mathcal{R}_0 = 2.5. (b) Compute the HIT numerically: find tt^* where I˙=0\dot{I} = 0 and verify St=1/R0S_{t^*} = 1/\mathcal{R}_0. (c) Simulate with 30%30\% voluntary reduction in contacts (multiply β\beta by 0.7) and compare the peak infection rate.

Exercise 38.2 (Python — Vaccine Arrival Timing)

Simulate the ERT model with a vaccine arriving at TV{26,52,78,104}T_V \in \{26, 52, 78, 104\} weeks (6, 12, 18, 24 months) with ν=0.7\nu = 0.7 coverage. (a) For each TVT_V, compute: total infections before vaccine, GDP loss, and welfare. (b) Plot the trade-off between earlier vaccine arrival and total pandemic cost. (c) Estimate the value of a 6-month acceleration in vaccine development (the “vaccine acceleration premium”) in welfare units.

Exercise 38.3 (Julia — Externality Quantification)

# Quantify the contagion externality
function externality_size(I_current; pi_C=5e-5, pi_N=5e-5, S=0.7)
    # Marginal infection cost of consuming one unit more
    # = pi_C * I * S * (value loss from infecting one person)
    # Value loss per infection ≈ present value of illness duration * utility loss
    value_loss_per_infection = 0.1 / 0.2  # 0.1 utility loss / 0.2 recovery rate
    marginal_ext = pi_C * I_current * S * value_loss_per_infection
    return marginal_ext
end

I_vals = [0.001, 0.01, 0.05, 0.10, 0.20]
println("Contagion externality (marginal cost of consuming one unit more):")
for I in I_vals
    ext = externality_size(I)
    println("  I = $(I*100)%: externality = $(round(ext,digits=5)) utility units")
end
println("Competitive equilibrium ignores this cost; optimal lockdown internalizes it.")

Exercise 38.4 — SIR-HANK Model (\star)

Extend the ERT model to include heterogeneous households (high- vs. low-contact workers). (a) Define two types: essential workers (high πN\pi^N, cannot work from home) and remote workers (low πN\pi^N, can substitute home for office work). (b) The optimal lockdown imposes different restrictions on essential vs. remote workers. Derive the optimal activity level for each type using the social planner’s Hamiltonian. (c) Quantify the distributional impact: essential workers bear higher infection risk and lower income; remote workers bear lower infection risk but face consumption restrictions.


38.9 Chapter Summary

Key results:

  • The SIR model partitions the population into (S,I,R)(S, I, R) with dynamics S˙=βSI\dot{S} = -\beta SI, I˙=βSIγI\dot{I} = \beta SI - \gamma I; the basic reproduction number R0=β/γ\mathcal{R}_0 = \beta/\gamma determines whether the epidemic grows; herd immunity threshold HIT=11/R0HIT = 1-1/\mathcal{R}_0 (Theorem 38.1).

  • The ERT model makes the transmission rate endogenous: βt=πCCt+πNNt+π0\beta_t = \pi^C C_t + \pi^N N_t + \pi^0; households voluntarily reduce activity to avoid infection but do not internalize the infection externality.

  • The contagion externality is the additional infection risk each agent’s activity imposes on others; the social planner internalizes this, prescribing a lockdown even when private agents would not voluntarily reduce activity.

  • The optimal lockdown condition (Theorem 38.2): social planner’s FOC for consumption includes an externality correction proportional to (λSλI)πCIt(\lambda^S - \lambda^I)\pi^C I_t — the shadow cost of spreading infection multiplied by the contact rate.

  • ELB + pandemic: fiscal policy is both a stabilizer (supports demand) and a public health tool (shapes the composition of spending toward low-transmission activities).

  • In APL: SIR is sir_step \ T ⍴ ⊂(S0 I0 R0); the optimal lockdown uses the Hamiltonian costate equations from Chapter 11.

Next: Chapter 39 — Forecasting Inflation and GDP: Time Series vs. DSGE