{
"cells": [
{
"cell_type": "markdown",
"id": "c6fbe24c",
"metadata": {},
"source": [
"$$\n",
"\\newcommand{\\argmax}{arg\\,max}\n",
"\\newcommand{\\argmin}{arg\\,min}\n",
"\\newcommand{\\col}{col}\n",
"\\newcommand{\\Span}{span}\n",
"\\newcommand{\\epsilon}{\\varepsilon}\n",
"\\newcommand{\\EE}{\\mathbb{E}}\n",
"\\newcommand{\\PP}{\\mathbb{P}}\n",
"\\newcommand{\\RR}{\\mathbb{R}}\n",
"\\newcommand{\\NN}{\\mathbb{N}}\n",
"\\newcommand{\\ZZ}{\\mathbb{Z}}\n",
"\\newcommand{\\aA}{\\mathcal{A}}\n",
"\\newcommand{\\bB}{\\mathcal{B}}\n",
"\\newcommand{\\cC}{\\mathcal{C}}\n",
"\\newcommand{\\dD}{\\mathcal{D}}\n",
"\\newcommand{\\eE}{\\mathcal{E}}\n",
"\\newcommand{\\fF}{\\mathcal{F}}\n",
"\\newcommand{\\gG}{\\mathcal{G}}\n",
"\\newcommand{\\hH}{\\mathcal{H}}\n",
"$$"
]
},
{
"cell_type": "markdown",
"id": "0c93012c",
"metadata": {},
"source": [
"\n",
"\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "0cd3bc74",
"metadata": {},
"source": [
"# How to Pay for a War: Part 3"
]
},
{
"cell_type": "markdown",
"id": "a87b412d",
"metadata": {},
"source": [
"## Overview\n",
"\n",
"This lecture presents another application of Markov jump linear quadratic dynamic programming and constitutes a [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 of [[Barro, 1999](https://python-advanced.quantecon.org/zreferences.html#id242)] and [[Barro and McCleary, 2003](https://python-advanced.quantecon.org/zreferences.html#id243)]) that\n",
"extend the classic [[Barro, 1979](https://python-advanced.quantecon.org/zreferences.html#id142)] model of tax smoothing.\n",
"\n",
"[[Barro, 1979](https://python-advanced.quantecon.org/zreferences.html#id142)] 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, 1979](https://python-advanced.quantecon.org/zreferences.html#id142)] looks a lot like a consumption-smoothing model.\n",
"\n",
"Our generalization will also look\n",
"like a souped-up consumption-smoothing model.\n",
"\n",
"In this lecture, we describe a tax-smoothing problem of a\n",
"government that faces **roll-over risk**.\n",
"\n",
"In addition to what’s in Anaconda, this lecture deploys the quantecon library:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "de463bc8",
"metadata": {
"hide-output": false
},
"outputs": [],
"source": [
"!pip install --upgrade quantecon"
]
},
{
"cell_type": "markdown",
"id": "0fbba68c",
"metadata": {},
"source": [
"Let’s start with some standard imports:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c17b1330",
"metadata": {
"hide-output": false
},
"outputs": [],
"source": [
"import quantecon as qe\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"id": "edc8f056",
"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) $.\n",
"\n",
"Let\n",
"\n",
"- $ T_t, b_{t, t+1} $ be *controls* chosen at $ t $ \n",
"- $ b_{t-1,t} $ be an endogenous state variable inherited from\n",
" the past at time $ t $ \n",
"- $ p^t_{t+1} $ be an exogenous price at time $ t $. \n",
"\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": "9d3d1c56",
"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\n",
"\n",
"- Riccati equations will tell us this \n",
"\n",
"\n",
"Thus, we must represent “roll-over risk” some other way."
]
},
{
"cell_type": "markdown",
"id": "fc2e5863",
"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": "d3c3813d",
"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": "7948a931",
"metadata": {},
"source": [
"Using the same process for $ G_t $ as\n",
"in [this lecture](https://python-advanced.quantecon.org/tax_smoothing_2.html), we shall simulate our model with roll-over risk.\n",
"\n",
"When $ p^t_{t+1} = \\beta $\n",
"government debt fluctuates around zero.\n",
"\n",
"The spikes in the tax collection series indicate periods when the government is unable to access financial\n",
"markets:\n",
"\n",
"- positive spikes occur when debt is positive and the government\n",
" must urgently raise tax revenues now \n",
"\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": "2647edc2",
"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": "7f67fe0f",
"metadata": {},
"source": [
"We can adjust parameters so that, rather than debt fluctuating\n",
"around zero, the government is a debtor in every period that it can 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": "7ac03cd1",
"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": "da4659ce",
"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 tax collections spike up.\n",
"\n",
"In this model, high costs of a “sudden stop” make the government wary about letting its debt get too high."
]
}
],
"metadata": {
"date": 1769597376.378463,
"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
}