{
"cells": [
{
"cell_type": "markdown",
"id": "2ef6ef85",
"metadata": {},
"source": [
"\n",
"\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "a618322c",
"metadata": {},
"source": [
"# How to Pay for a War: Part 3"
]
},
{
"cell_type": "markdown",
"id": "dbe9494e",
"metadata": {},
"source": [
"## Contents\n",
"\n",
"- [How to Pay for a War: Part 3](#How-to-Pay-for-a-War:-Part-3) \n",
" - [Another Application of Markov Jump Linear Quadratic Dynamic Programming](#Another-Application-of-Markov-Jump-Linear-Quadratic-Dynamic-Programming) \n",
" - [Roll-Over Risk](#Roll-Over-Risk) \n",
" - [A Dead End](#A-Dead-End) \n",
" - [Better Representation of Roll-Over Risk](#Better-Representation-of-Roll-Over-Risk) "
]
},
{
"cell_type": "markdown",
"id": "ecaeddd9",
"metadata": {},
"source": [
"In addition to what’s in Anaconda, this lecture deploys the quantecon library:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "74a12698",
"metadata": {
"hide-output": false
},
"outputs": [],
"source": [
"!pip install --upgrade quantecon"
]
},
{
"cell_type": "markdown",
"id": "4d5e861f",
"metadata": {},
"source": [
"## Another Application of Markov Jump Linear Quadratic Dynamic Programming\n",
"\n",
"This is another [sequel to an earlier lecture](https://python-advanced.quantecon.org/tax_smoothing_1.html).\n",
"\n",
"We again use a method introduced in lecture [Markov Jump LQ dynamic programming](https://python-advanced.quantecon.org/markov_jump_lq.html)\n",
"to implement some ideas Barro (1999 [[Bar99](https://python-advanced.quantecon.org/zreferences.html#id236)], 2003 [[BM03](https://python-advanced.quantecon.org/zreferences.html#id237)]) that\n",
"extend his classic 1979 [[Bar79](https://python-advanced.quantecon.org/zreferences.html#id136)] model of tax smoothing.\n",
"\n",
"Barro’s 1979 [[Bar79](https://python-advanced.quantecon.org/zreferences.html#id136)] model is about a government that borrows and lends in order\n",
"to help it minimize an intertemporal measure of distortions caused by\n",
"taxes.\n",
"\n",
"Technically, Barro’s 1979 [[Bar79](https://python-advanced.quantecon.org/zreferences.html#id136)] model looks a lot like a consumption-smoothing model.\n",
"\n",
"Our generalizations of his 1979 model will also look\n",
"like souped-up consumption-smoothing models.\n",
"\n",
"In this lecture, we describe a tax-smoothing problem of a\n",
"government that faces **roll-over risk**.\n",
"\n",
"Let’s start with some standard imports:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9648b1e2",
"metadata": {
"hide-output": false
},
"outputs": [],
"source": [
"import quantecon as qe\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"id": "e5805f09",
"metadata": {},
"source": [
"## Roll-Over Risk\n",
"\n",
"Let $ T_t $ denote tax collections, $ \\beta $ a discount factor,\n",
"$ b_{t,t+1} $ time $ t+1 $ goods that the government promises to\n",
"pay at $ t $, $ G_t $ government purchases, $ p^t_{t+1} $\n",
"the number of time $ t $ goods received per time $ t+1 $ goods\n",
"promised.\n",
"\n",
"The stochastic process of government expenditures is\n",
"exogenous.\n",
"\n",
"The government’s problem is to choose a plan for borrowing\n",
"and tax collections $ \\{b_{t+1}, T_t\\}_{t=0}^\\infty $ to minimize\n",
"\n",
"$$\n",
"E_0 \\sum_{t=0}^\\infty \\beta^t T_t^2\n",
"$$\n",
"\n",
"subject to the constraints\n",
"\n",
"$$\n",
"T_t + p^t_{t+1} b_{t,t+1} = G_t + b_{t-1,t}\n",
"$$\n",
"\n",
"$$\n",
"G_t = U_{g,t} z_t\n",
"$$\n",
"\n",
"$$\n",
"z_{t+1} = A_{22,t} z_t + C_{2,t} w_{t+1}\n",
"$$\n",
"\n",
"where $ w_{t+1} \\sim {\\cal N}(0,I) $. The variables\n",
"$ T_t, b_{t, t+1} $ are *control* variables chosen at $ t $,\n",
"while $ b_{t-1,t} $ is an endogenous state variable inherited from\n",
"the past at time $ t $ and $ p^t_{t+1} $ is an exogenous state\n",
"variable at time $ t $.\n",
"\n",
"This is the same set-up as used [in this lecture](https://python-advanced.quantecon.org/tax_smoothing_1.html).\n",
"\n",
"We will consider a situation in which the government faces “roll-over\n",
"risk”.\n",
"\n",
"Specifically, we shut down the government’s ability to borrow in\n",
"one of the Markov states."
]
},
{
"cell_type": "markdown",
"id": "9afab0af",
"metadata": {},
"source": [
"## A Dead End\n",
"\n",
"A first thought for how to implement this might be to allow\n",
"$ p^t_{t+1} $ to vary over time with:\n",
"\n",
"$$\n",
"p^t_{t+1} = \\beta\n",
"$$\n",
"\n",
"in Markov state 1 and\n",
"\n",
"$$\n",
"p^t_{t+1} = 0\n",
"$$\n",
"\n",
"in Markov state 2.\n",
"\n",
"Consequently, in the second Markov state, the\n",
"government is unable to borrow, and the budget constraint becomes\n",
"$ T_t = G_t + b_{t-1,t} $.\n",
"\n",
"However, if this is the only adjustment we make in our linear-quadratic\n",
"model, the government will not set $ b_{t,t+1} = 0 $, which is the\n",
"outcome we want to express *roll-over* risk in period $ t $.\n",
"\n",
"Instead, the government would have an incentive to set $ b_{t,t+1} $\n",
"to a large negative number in state 2 – it would accumulate large\n",
"amounts of *assets* to bring into period $ t+1 $ because that is\n",
"cheap (Our Riccati equations will discover this for us!).\n",
"\n",
"Thus, we must represent “roll-over risk” some other way."
]
},
{
"cell_type": "markdown",
"id": "9f79c7ad",
"metadata": {},
"source": [
"## Better Representation of Roll-Over Risk\n",
"\n",
"To force the government to set $ b_{t,t+1} = 0 $, we can instead\n",
"extend the model to have four Markov states:\n",
"\n",
"1. Good today, good yesterday \n",
"1. Good today, bad yesterday \n",
"1. Bad today, good yesterday \n",
"1. Bad today, bad yesterday \n",
"\n",
"\n",
"where good is a state in which effectively the government can issue debt\n",
"and bad is a state in which effectively the government can’t issue debt.\n",
"\n",
"We’ll explain what *effectively* means shortly.\n",
"\n",
"We now set\n",
"\n",
"$$\n",
"p^t_{t+1} = \\beta\n",
"$$\n",
"\n",
"in all states.\n",
"\n",
"In addition – and this is important because it defines what we mean by\n",
"*effectively* – we put a large penalty on the $ b_{t-1,t} $\n",
"element of the state vector in states 2 and 4.\n",
"\n",
"This will prevent the\n",
"government from wishing to issue any debt in states 3 or 4 because it\n",
"would experience a large penalty from doing so in the next period.\n",
"\n",
"The transition matrix for this formulation is:\n",
"\n",
"$$\n",
"\\Pi = \\begin{bmatrix} 0.95 & 0 & 0.05 & 0 \\\\\n",
" 0.95 & 0 & 0.05 & 0 \\\\\n",
" 0 & 0.9 & 0 & 0.1 \\\\\n",
" 0 & 0.9 & 0 & 0.1 \\\\\n",
"\\end{bmatrix}\n",
"$$\n",
"\n",
"This transition matrix ensures that the Markov state cannot move, for\n",
"example, from state 3 to state 1.\n",
"\n",
"Because state 3 is “bad today”, the next period cannot have “good yesterday”."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d03f9aaf",
"metadata": {
"hide-output": false
},
"outputs": [],
"source": [
"# Model parameters\n",
"β, Gbar, ρ, σ = 0.95, 5, 0.8, 1\n",
"\n",
"# Basic model matrices\n",
"A22 = np.array([[1, 0], [Gbar, ρ], ])\n",
"C2 = np.array([[0], [σ]])\n",
"Ug = np.array([[0, 1]])\n",
"\n",
"# LQ framework matrices\n",
"A_t = np.zeros((1, 3))\n",
"A_b = np.hstack((np.zeros((2, 1)), A22))\n",
"A = np.vstack((A_t, A_b))\n",
"\n",
"B = np.zeros((3, 1))\n",
"B[0, 0] = 1\n",
"\n",
"C = np.vstack((np.zeros((1, 1)), C2))\n",
"\n",
"Sg = np.hstack((np.zeros((1, 1)), Ug))\n",
"S1 = np.zeros((1, 3))\n",
"S1[0, 0] = 1\n",
"S = S1 + Sg\n",
"\n",
"R = S.T @ S\n",
"\n",
"# Large penalty on debt in R2 to prevent borrowing in a bad state\n",
"R1 = np.copy(R)\n",
"R2 = np.copy(R)\n",
"R1[0, 0] = R[0, 0] + 1e-9\n",
"R2[0, 0] = R[0, 0] + 1e12\n",
"\n",
"M = np.array([[-β]])\n",
"Q = M.T @ M\n",
"W = M.T @ S\n",
"\n",
"Π = np.array([[0.95, 0, 0.05, 0],\n",
" [0.95, 0, 0.05, 0],\n",
" [0, 0.9, 0, 0.1],\n",
" [0, 0.9, 0, 0.1]])\n",
"\n",
"# Construct lists of matrices that correspond to each state\n",
"As = [A, A, A, A]\n",
"Bs = [B, B, B, B]\n",
"Cs = [C, C, C, C]\n",
"Rs = [R1, R2, R1, R2]\n",
"Qs = [Q, Q, Q, Q]\n",
"Ws = [W, W, W, W]\n",
"\n",
"lqm = qe.LQMarkov(Π, Qs, Rs, As, Bs, Cs=Cs, Ns=Ws, beta=β)\n",
"lqm.stationary_values();"
]
},
{
"cell_type": "markdown",
"id": "0f8a8732",
"metadata": {},
"source": [
"This model is simulated below, using the same process for $ G_t $ as\n",
"in [this lecture](https://python-advanced.quantecon.org/tax_smoothing_2.html).\n",
"\n",
"When $ p^t_{t+1} = \\beta $\n",
"government debt fluctuates around zero.\n",
"\n",
"The spikes in the series for\n",
"taxation show periods when the government is unable to access financial\n",
"markets: positive spikes occur when debt is positive, and the government\n",
"must raise taxes in the current period.\n",
"\n",
"Negative spikes occur when the government has positive asset holdings.\n",
"\n",
"An inability to use financial markets in the next period means that the\n",
"government uses those assets to lower taxation today."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8b55e856",
"metadata": {
"hide-output": false
},
"outputs": [],
"source": [
"x0 = np.array([[0, 1, 25]])\n",
"T = 300\n",
"x, u, w, state = lqm.compute_sequence(x0, ts_length=T)\n",
"\n",
"# Calculate taxation each period from the budget constraint and the Markov state\n",
"tax = np.zeros([T, 1])\n",
"for i in range(T):\n",
" tax[i, :] = S @ x[:, i] + M @ u[:, i]\n",
"\n",
"# Plot of debt issuance and taxation\n",
"fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 3))\n",
"ax1.plot(x[0, :])\n",
"ax1.set_title('One-period debt issuance')\n",
"ax1.set_xlabel('Time')\n",
"ax2.plot(tax)\n",
"ax2.set_title('Taxation')\n",
"ax2.set_xlabel('Time')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "e9a4cb34",
"metadata": {},
"source": [
"We can adjust the model so that, rather than having debt fluctuate\n",
"around zero, the government is a debtor in every period we allow it to\n",
"borrow.\n",
"\n",
"To accomplish this, we simply raise $ p^t_{t+1} $ to\n",
"$ \\beta + 0.02 = 0.97 $."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "69e17bf6",
"metadata": {
"hide-output": false
},
"outputs": [],
"source": [
"M = np.array([[-β - 0.02]])\n",
"\n",
"Q = M.T @ M\n",
"W = M.T @ S\n",
"\n",
"# Construct lists of matrices\n",
"As = [A, A, A, A]\n",
"Bs = [B, B, B, B]\n",
"Cs = [C, C, C, C]\n",
"Rs = [R1, R2, R1, R2]\n",
"Qs = [Q, Q, Q, Q]\n",
"Ws = [W, W, W, W]\n",
"\n",
"lqm2 = qe.LQMarkov(Π, Qs, Rs, As, Bs, Cs=Cs, Ns=Ws, beta=β)\n",
"x, u, w, state = lqm2.compute_sequence(x0, ts_length=T)\n",
"\n",
"# Calculate taxation each period from the budget constraint and the\n",
"# Markov state\n",
"tax = np.zeros([T, 1])\n",
"for i in range(T):\n",
" tax[i, :] = S @ x[:, i] + M @ u[:, i]\n",
"\n",
"# Plot of debt issuance and taxation\n",
"fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 3))\n",
"ax1.plot(x[0, :])\n",
"ax1.set_title('One-period debt issuance')\n",
"ax1.set_xlabel('Time')\n",
"ax2.plot(tax)\n",
"ax2.set_title('Taxation')\n",
"ax2.set_xlabel('Time')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "87b2ea72",
"metadata": {},
"source": [
"With a lower interest rate, the government has an incentive to\n",
"increase debt over time.\n",
"\n",
"However, with “roll-over risk”, debt is\n",
"recurrently reset to zero and taxes spike up.\n",
"\n",
"Consequently, the\n",
"government is wary of letting debt get too high, due to the high costs of\n",
"a “sudden stop”."
]
}
],
"metadata": {
"date": 1686803697.9376829,
"filename": "tax_smoothing_3.md",
"kernelspec": {
"display_name": "Python",
"language": "python3",
"name": "python3"
},
"title": "How to Pay for a War: Part 3"
},
"nbformat": 4,
"nbformat_minor": 5
}