9. How to Pay for a War: Part 1#

9.1. Overview#

This lecture uses the method of Markov jump linear quadratic dynamic programming that is described in lecture Markov Jump LQ dynamic programming to extend the [Barro, 1979] model of optimal tax-smoothing and government debt in a particular direction.

This lecture has two sequels that offer further extensions of the Barro model

  1. How to Pay for a War: Part 2

  2. How to Pay for a War: Part 3

The extensions are modified versions of his 1979 model suggested by [Barro, 1999] and [Barro and McCleary, 2003]).

[Barro, 1979] m is about a government that borrows and lends in order to minimize an intertemporal measure of distortions caused by taxes.

Technical tractability induced [Barro, 1979] to assume that

  • the government trades only one-period risk-free debt, and

  • the one-period risk-free interest rate is constant

By using Markov jump linear quadratic dynamic programming we can allow interest rates to move over time in empirically interesting ways.

Also, by expanding the dimension of the state, we can add a maturity composition decision to the government’s problem.

By doing these two things we extend [Barro, 1979] along lines he suggested in [Barro, 1999] and [Barro and McCleary, 2003]).

[Barro, 1979] assumed

  • that a government faces an exogenous sequence of expenditures that it must finance by a tax collection sequence whose expected present value equals the initial debt it owes plus the expected present value of those expenditures.

  • that the government wants to minimize a measure of tax distortions that is proportional to E0t=0βtTt2, where Tt are total tax collections and E0 is a mathematical expectation conditioned on time 0 information.

  • that the government trades only one asset, a risk-free one-period bond.

  • that the gross interest rate on the one-period bond is constant and equal to β1, the reciprocal of the factor β at which the government discounts future tax distortions.

Barro’s model can be mapped into a discounted linear quadratic dynamic programming problem.

Partly inspired by [Barro, 1999] and [Barro and McCleary, 2003], our generalizations of [Barro, 1979], assume

  • that the government borrows or saves in the form of risk-free bonds of maturities 1,2,,H.

  • that interest rates on those bonds are time-varying and in particular, governed by a jointly stationary stochastic process.

Our generalizations are designed to fit within a generalization of an ordinary linear quadratic dynamic programming problem in which matrices that define the quadratic objective function and the state transition function are time-varying and stochastic.

This generalization, known as a Markov jump linear quadratic dynamic program, combines

  • the computational simplicity of linear quadratic dynamic programming, and

  • the ability of finite state Markov chains to represent interesting patterns of random variation.

We want the stochastic time variation in the matrices defining the dynamic programming problem to represent variation over time in

  • interest rates

  • default rates

  • roll over risks

As described in Markov Jump LQ dynamic programming, the idea underlying Markov jump linear quadratic dynamic programming is to replace the constant matrices defining a linear quadratic dynamic programming problem with matrices that are fixed functions of an N state Markov chain.

For infinite horizon problems, this leads to N interrelated matrix Riccati equations that pin down N value functions and N linear decision rules, applying to the N Markov states.

9.2. Public Finance Questions#

[Barro, 1979] is designed to answer questions such as

  • Should a government finance an exogenous surge in government expenditures by raising taxes or borrowing?

  • How does the answer to that first question depend on the exogenous stochastic process for government expenditures, for example, on whether the surge in government expenditures can be expected to be temporary or permanent?

[Barro, 1999] and [Barro and McCleary, 2003] are designed to answer more fine-grained questions such as

  • What determines whether a government wants to issue short-term or long-term debt?

  • How do roll-over risks affect that decision?

  • How does the government’s long-short portfolio management decision depend on features of the exogenous stochastic process for government expenditures?

Thus, both the simple and the more fine-grained versions of Barro’s models are ways of precisely formulating the classic issue of How to pay for a war.

This lecture describes:

  • An application of Markov jump LQ dynamic programming to a model in which a government faces exogenous time-varying interest rates for issuing one-period risk-free debt.

A sequel to this lecture describes applies Markov LQ control to settings in which a government issues risk-free debt of different maturities.

!pip install --upgrade quantecon

Hide code cell output

Requirement already satisfied: quantecon in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (0.8.2)
Requirement already satisfied: numba>=0.49.0 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from quantecon) (0.60.0)
Requirement already satisfied: numpy>=1.17.0 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from quantecon) (1.26.4)
Requirement already satisfied: requests in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from quantecon) (2.32.3)
Requirement already satisfied: scipy>=1.5.0 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from quantecon) (1.13.1)
Requirement already satisfied: sympy in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from quantecon) (1.13.2)
Requirement already satisfied: llvmlite<0.44,>=0.43.0dev0 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from numba>=0.49.0->quantecon) (0.43.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from requests->quantecon) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from requests->quantecon) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from requests->quantecon) (2.2.3)
Requirement already satisfied: certifi>=2017.4.17 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from requests->quantecon) (2024.8.30)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from sympy->quantecon) (1.3.0)

Let’s start with some standard imports:

import quantecon as qe
import numpy as np
import matplotlib.pyplot as plt

9.3. Barro (1979) Model#

We begin by solving a version of [Barro, 1979] by mapping it into the original LQ framework.

As mentioned in this lecture, the Barro model is mathematically isomorphic with the LQ permanent income model.

Let

  • Tt denote tax collections

  • β be a discount factor

  • bt,t+1 be time t+1 goods that at t the government promises to deliver to time t buyers of one-period government bonds

  • Gt be government purchases

  • pt,t+1 the number of time t goods received per time t+1 goods promised to one-period bond purchasers.

Evidently, pt,t+1 is inversely related to appropriate corresponding gross interest rates on government debt.

In the spirit of [Barro, 1979], the stochastic process of government expenditures is exogenous.

The government’s problem is to choose a plan for taxation and borrowing {bt+1,Tt}t=0 to minimize

E0t=0βtTt2

subject to the constraints

Tt+pt,t+1bt,t+1=Gt+bt1,t
Gt=Ugzt
zt+1=A22zt+C2wt+1

where wt+1N(0,I)

The variables Tt,bt,t+1 are control variables chosen at t, while bt1,t is an endogenous state variable inherited from the past at time t and pt,t+1 is an exogenous state variable at time t.

To begin, we assume that pt,t+1 is constant (and equal to β)

  • later we will extend the model to allow pt,t+1 to vary over time

To map into the LQ framework, we use xt=[bt1,tzt] as the state vector, and ut=bt,t+1 as the control variable.

Therefore, the (A,B,C) matrices are defined by the state-transition law:

xt+1=[000A22]xt+[10]ut+[0C2]wt+1

To find the appropriate (R,Q,W) matrices, we note that Gt and bt1,t can be written as appropriately defined functions of the current state:

Gt=SGxt,bt1,t=S1xt

If we define Mt=pt,t+1, and let S=SG+S1, then we can write taxation as a function of the states and control using the government’s budget constraint:

Tt=Sxt+Mtut

It follows that the (R,Q,W) matrices are implicitly defined by:

Tt2=xtSSxt+utMtMtut+2utMtSxt

If we assume that pt,t+1=β, then MtM=β.

In this case, none of the LQ matrices are time varying, and we can use the original LQ framework.

We will implement this constant interest-rate version first, assuming that Gt follows an AR(1) process:

Gt+1=G¯+ρGt+σwt+1

To do this, we set zt=[1Gt], and consequently:

A22=[10G¯ρ],C2=[0σ]
# Model parameters
β, Gbar, ρ, σ = 0.95, 5, 0.8, 1

# Basic model matrices
A22 = np.array([[1,    0],
                [Gbar, ρ],])

C2 = np.array([[0],
               [σ]])

Ug = np.array([[0, 1]])

# LQ framework matrices
A_t = np.zeros((1, 3))
A_b = np.hstack((np.zeros((2, 1)), A22))
A = np.vstack((A_t, A_b))

B = np.zeros((3, 1))
B[0, 0] = 1

C = np.vstack((np.zeros((1, 1)), C2))

Sg = np.hstack((np.zeros((1, 1)), Ug))
S1 = np.zeros((1, 3))
S1[0, 0] = 1
S = S1 + Sg

M = np.array([[-β]])

R = S.T @ S
Q = M.T @ M
W = M.T @ S

# Small penalty on the debt required to implement the no-Ponzi scheme
R[0, 0] = R[0, 0] + 1e-9

We can now create an instance of LQ:

LQBarro = qe.LQ(Q, R, A, B, C=C, N=W, beta=β)
P, F, d = LQBarro.stationary_values()
x0 = np.array([[100, 1, 25]])

We can see the isomorphism by noting that consumption is a martingale in the permanent income model and that taxation is a martingale in Barro’s model.

We can check this using the F matrix of the LQ model.

Because ut=Fxt, we have

Tt=Sxt+Mut=(SMF)xt

and

Tt+1=(SMF)xt+1=(SMF)(Axt+But+Cwt+1)=(SMF)((ABF)xt+Cwt+1)

Therefore, the mathematical expectation of Tt+1 conditional on time t information is

EtTt+1=(SMF)(ABF)xt

Consequently, taxation is a martingale (EtTt+1=Tt) if

(SMF)(ABF)=(SMF),

which holds in this case:

S - M @ F, (S - M @ F) @ (A - B @ F)
(array([[ 0.05000002, 19.79166502,  0.2083334 ]]),
 array([[ 0.05000002, 19.79166504,  0.2083334 ]]))

This explains the fanning out of the conditional empirical distribution of taxation across time, computed by simulating the Barro model many times and averaging over simulated paths:

T = 500
for i in range(250):
    x, u, w = LQBarro.compute_sequence(x0, ts_length=T)
    plt.plot(list(range(T+1)), ((S - M @ F) @ x)[0, :])
plt.xlabel('Time')
plt.ylabel('Taxation')
plt.show()
_images/fdea15fed5eeb6ccc75c145a1287f7e809ed9b3b45db80f31b85e55f8f2ee63a.png

We can see a similar, but a smoother pattern, if we plot government debt over time.

T = 500
for i in range(250):
    x, u, w = LQBarro.compute_sequence(x0, ts_length=T)
    plt.plot(list(range(T+1)), x[0, :])
plt.xlabel('Time')
plt.ylabel('Govt Debt')
plt.show()
_images/e6b4e66f6380be0029f9725639673e41273f709bef91449192e0e7db7a36b415.png

9.4. Python Class to Solve Markov Jump Linear Quadratic Control Problems#

To implement the extension to the Barro model in which pt,t+1 varies over time, we must allow the M matrix to be time-varying.

Our Q and W matrices must also vary over time.

We can solve such a model using the LQMarkov class that solves Markov jump linear quandratic control problems as described above.

The code for the class can be viewed here.

The class takes lists of matrices that corresponds to N Markov states.

The value and policy functions are then found by iterating on a coupled system of matrix Riccati difference equations.

Optimal Ps,Fs,ds are stored as attributes.

The class also contains a method that simulates a model.

9.5. Barro Model with a Time-varying Interest Rate#

We can use the above class to implement a version of the Barro model with a time-varying interest rate.

A simple way to extend the model is to allow the interest rate to take two possible values.

We set:

pt,t+11=β+0.02=0.97
pt,t+12=β0.017=0.933

Thus, the first Markov state has a low interest rate and the second Markov state has a high interest rate.

We must also specify a transition matrix for the Markov state.

We use:

Π=[0.80.20.20.8]

Here, each Markov state is persistent, and there is are equal chances of moving from one state to the other.

The choice of parameters means that the unconditional expectation of pt,t+1 is 0.9515, higher than β(=0.95).

If we were to set pt,t+1=0.9515 in the version of the model with a constant interest rate, government debt would explode.

# Create list of matrices that corresponds to each Markov state
Π = np.array([[0.8, 0.2],
              [0.2, 0.8]])

As = [A, A]
Bs = [B, B]
Cs = [C, C]
Rs = [R, R]

M1 = np.array([[-β - 0.02]])
M2 = np.array([[-β + 0.017]])

Q1 = M1.T @ M1
Q2 = M2.T @ M2
Qs = [Q1, Q2]
W1 = M1.T @ S
W2 = M2.T @ S
Ws = [W1, W2]

# create Markov Jump LQ DP problem instance
lqm = qe.LQMarkov(Π, Qs, Rs, As, Bs, Cs=Cs, Ns=Ws, beta=β)
lqm.stationary_values();

The decision rules are now dependent on the Markov state:

lqm.Fs[0]
array([[-0.98437712, 19.20516427, -0.8314215 ]])
lqm.Fs[1]
array([[-1.01434301, 21.5847983 , -0.83851116]])

Simulating a large number of such economies over time reveals interesting dynamics.

Debt tends to stay low and stable but recurrently surges.

T = 2000
x0 = np.array([[1000, 1, 25]])
for i in range(250):
    x, u, w, s = lqm.compute_sequence(x0, ts_length=T)
    plt.plot(list(range(T+1)), x[0, :])
plt.xlabel('Time')
plt.ylabel('Govt Debt')
plt.show()
_images/0a950c1c9bd4e60c660f6395528a7ac05514b3a03e01d3e739badc6fb8f5c3e9.png