diff --git a/lectures/BCG_incomplete_mkts.md b/lectures/BCG_incomplete_mkts.md index 8923bb8a..7c2445c1 100644 --- a/lectures/BCG_incomplete_mkts.md +++ b/lectures/BCG_incomplete_mkts.md @@ -242,7 +242,7 @@ show up in differences in the two types of consumers’ demands for a typical firm’s bonds and equity, the only two assets that agents can now trade. -## Asset Markets +## Asset markets Markets are incomplete: *ex cathedra* we the model builders declare that only equities and bonds issued by representative firms can be traded. @@ -548,7 +548,7 @@ $C$’s that appear in the pricing functions, then - $\check q = q(K,B)$ and $\check p = p(K,B)$. -## Pseudo Code +## Pseudo code Before displaying our Python code for computing a BCG incomplete markets equilibrium, we’ll sketch some pseudo code that describes its logical flow. diff --git a/lectures/additive_functionals.md b/lectures/additive_functionals.md index 5dae78cb..326fb085 100644 --- a/lectures/additive_functionals.md +++ b/lectures/additive_functionals.md @@ -77,7 +77,7 @@ import matplotlib.pyplot as plt from scipy.stats import norm, lognorm ``` -## A Particular Additive Functional +## A particular additive functional {cite}`Hansen_2012_Eca` describes a general class of additive functionals. @@ -123,7 +123,7 @@ initial condition for $y$. The nonstationary random process $\{y_t\}_{t=0}^\infty$ displays systematic but random *arithmetic growth*. -### Linear State-Space Representation +### Linear state-space representation A convenient way to represent our additive functional is to use a [linear state space system](https://python-intro.quantecon.org/linear_models.html). @@ -872,7 +872,7 @@ Notice tell-tale signs of these probability coverage shaded areas * the green one for the stationary component $s_t$ converges to a constant band -### Associated Multiplicative Functional +### Associated multiplicative functional Where $\{y_t\}$ is our additive functional, let $M_t = \exp(y_t)$. @@ -929,7 +929,7 @@ It is interesting to how the martingale behaves as $T \rightarrow +\infty$. Let's see what happens when we set $T = 12000$ instead of $150$. -### Peculiar Large Sample Property +### Peculiar large sample property Hansen and Sargent {cite}`Hans_Sarg_book` (ch. 8) describe the following two properties of the martingale component $\widetilde M_t$ of the multiplicative decomposition @@ -958,7 +958,7 @@ It remains constant at unity, illustrating the first property. The purple 95 percent frequency coverage interval collapses around zero, illustrating the second property. -## More About the Multiplicative Martingale +## More about the multiplicative martingale Let's drill down and study probability distribution of the multiplicative martingale $\{\widetilde M_t\}_{t=0}^\infty$ in more detail. @@ -973,7 +973,7 @@ where $H = [F + D(I-A)^{-1} B]$. It follows that $\log {\widetilde M}_t \sim {\mathcal N} ( -\frac{t H \cdot H}{2}, t H \cdot H )$ and that consequently ${\widetilde M}_t$ is log normal. -### Simulating a Multiplicative Martingale Again +### Simulating a multiplicative martingale again Next, we want a program to simulate the likelihood ratio process $\{ \tilde{M}_t \}_{t=0}^\infty$. @@ -984,7 +984,7 @@ After accomplishing this, we want to display and study histograms of $\tilde{M}_ Here is code that accomplishes these tasks. -### Sample Paths +### Sample paths Let's write a program to simulate sample paths of $\{ x_t, y_{t} \}_{t=0}^{\infty}$. @@ -1257,7 +1257,7 @@ These probability density functions help us understand mechanics underlying the * Enough mass moves toward the right tail to keep $E \widetilde M_T = 1$ even as most mass in the distribution of $\widetilde M_T$ collapses around $0$. -### Multiplicative Martingale as Likelihood Ratio Process +### Multiplicative martingale as likelihood ratio process [This lecture](https://python.quantecon.org/likelihood_ratio_process.html) studies **likelihood processes** and **likelihood ratio processes**. diff --git a/lectures/amss.md b/lectures/amss.md index 0bb65d74..7ed2692f 100644 --- a/lectures/amss.md +++ b/lectures/amss.md @@ -61,7 +61,7 @@ In this lecture, we We begin with an introduction to the model. -## Competitive Equilibrium with Distorting Taxes +## Competitive equilibrium with distorting taxes Many but not all features of the economy are identical to those of {doc}`the Lucas-Stokey economy `. @@ -118,7 +118,7 @@ AMSS allow the government to issue only one-period risk-free debt each period. Ruling out complete markets in this way is a step in the direction of making total tax collections behave more like that prescribed in Robert Barro (1979) {cite}`Barro1979` than they do in Lucas and Stokey (1983) {cite}`LucasStokey1983`. -### Risk-free One-Period Debt Only +### Risk-free one-period debt only In period $t$ and history $s^t$, let @@ -244,7 +244,7 @@ b_t(s^{t-1}) = \mathbb E_t \sum_{j=0}^\infty \beta^j Equation {eq}`TS_gov_wo4a` must hold for each $s^t$ for each $t \geq 1$. -### Comparison with Lucas-Stokey Economy +### Comparison with Lucas-Stokey economy The expression on the right side of {eq}`TS_gov_wo4a` in the Lucas-Stokey (1983) economy would equal the present value of a continuation stream of government net-of-interest surpluses evaluated at what would be competitive equilibrium Arrow-Debreu prices at date $t$. @@ -254,7 +254,7 @@ In the AMSS economy, the restriction that government debt be risk-free imposes t In a language used in the literature on incomplete markets models, it can be said that the AMSS model requires that at each $(t, s^t)$ what would be the present value of continuation government net-of-interest surpluses in the Lucas-Stokey model must belong to the **marketable subspace** of the AMSS model. -### Ramsey Problem Without State-contingent Debt +### Ramsey problem without state-contingent debt After we have substituted the resource constraint into the utility function, we can express the Ramsey problem as being to choose an allocation that solves @@ -286,7 +286,7 @@ and given $b_0(s^{-1})$. -#### Lagrangian Formulation +#### Lagrangian formulation Let $\gamma_0(s^0)$ be a non-negative Lagrange multiplier on constraint {eq}`AMSS_44`. @@ -316,7 +316,7 @@ That would let us reduce the beginning-of-period indebtedness for some other his These features flow from the fact that the government cannot use state-contingent debt and therefore cannot allocate its indebtedness efficiently across future states. -### Some Calculations +### Some calculations It is helpful to apply two transformations to the Lagrangian. @@ -408,7 +408,7 @@ tags: [collapse-20] To analyze the AMSS model, we find it useful to adopt a recursive formulation using techniques like those in our lectures on {doc}`dynamic Stackelberg models ` and {doc}`optimal taxation with state-contingent debt `. -## Recursive Version of AMSS Model +## Recursive version of AMSS model We now describe a recursive formulation of the AMSS economy. @@ -424,7 +424,7 @@ We now explore how these constraints alter Bellman equations for a time $0$ Ramsey planner and for time $t \geq 1$, history $s^t$ continuation Ramsey planners. -### Recasting State Variables +### Recasting state variables In the AMSS setting, the government faces a sequence of budget constraints @@ -487,7 +487,7 @@ history $s^t$ as for $t \geq 1$. -### Measurability Constraints +### Measurability constraints Write equation {eq}`eqn:AMSSapp2` as @@ -510,7 +510,7 @@ That implies that it has to be *measurable* with respect to $s^{t-1}$. Equations {eq}`eqn:AMSSapp2b` are the *measurability constraints* that the AMSS model adds to the single time $0$ implementation constraint imposed in the Lucas and Stokey model. -### Two Bellman Equations +### Two Bellman equations Let $\Pi(s|s_-)$ be a Markov transition matrix whose entries tell probabilities of moving from state $s_-$ to state $s$ in one period. @@ -567,7 +567,7 @@ where maximization is subject to u_{c,0} b_0 = u_{c,0} (n_0-g_0) - u_{l,0} n_0 + x_0 ``` -### Martingale Supercedes State-Variable Degeneracy +### Martingale supercedes state-variable degeneracy Let $\mu(s|s_-) \Pi(s|s_-)$ be a Lagrange multiplier on the constraint {eq}`eqn:AMSSapp6` for state $s$. @@ -620,7 +620,7 @@ that for each $s_-$, the sum over $s$ equals unity. ```{exercise-end} ``` -### Absence of State Variable Degeneracy +### Absence of state variable degeneracy Along a Ramsey plan, the state variable $x_t = x_t(s^t, b_0)$ becomes a function of the history $s^t$ and initial @@ -642,7 +642,7 @@ In the AMSS model, both $x$ and $s$ are needed to describe the state. This property of the AMSS model transmits a twisted martingale component to consumption, employment, and the tax rate. -### Digression on Non-negative Transfers +### Digression on non-negative transfers Throughout this lecture, we have imposed that transfers $T_t = 0$. @@ -686,7 +686,7 @@ The recursive formulation is implemented as follows We now turn to some examples. -### Anticipated One-Period War +### Anticipated one-period war In our lecture on {doc}`optimal taxation with state-contingent debt ` we studied how the government manages uncertainty in a simple setting. @@ -874,7 +874,7 @@ Without state-contingent debt, the optimal tax rate is history dependent. * A war at time $t=3$ causes a permanent **increase** in the tax rate. * Peace at time $t=3$ causes a permanent **reduction** in the tax rate. -#### Perpetual War Alert +#### Perpetual war alert History dependence occurs more dramatically in a case in which the government perpetually faces the prospect of war. diff --git a/lectures/amss2.md b/lectures/amss2.md index c2668a61..30089093 100644 --- a/lectures/amss2.md +++ b/lectures/amss2.md @@ -88,7 +88,7 @@ import matplotlib.pyplot as plt from scipy.optimize import fsolve, fmin ``` -## Forces at Work +## Forces at work The forces driving asymptotic outcomes here are examples of dynamics present in a more general class of incomplete markets models analyzed in {cite}`BEGS1` (BEGS). @@ -112,7 +112,7 @@ rates rather than fluctuations in par values of debt to insure against shocks shutting down the stochastic component of debt dynamics. - At that point, the tail of the par value of government debt becomes a trivial martingale: it is constant over time. -## Logical Flow of Lecture +## Logical flow of lecture We present ideas in the following order @@ -126,7 +126,7 @@ We present ideas in the following order - we verify that the LS Ramsey planner chooses to purchase **identical** claims to time $t+1$ consumption for all Markov states tomorrow for each Markov state today. * We compute the BEGS approximations to check how accurately they describe the dynamics of the long-simulation. -### Equations from Lucas-Stokey (1983) Model +### Equations from Lucas-Stokey (1983) model Although we are studying an AMSS {cite}`aiyagari2002optimal` economy, a Lucas-Stokey {cite}`LucasStokey1983` economy plays an important role in the reverse-engineering calculation to be described below. @@ -189,7 +189,7 @@ $$ It is useful to transform some of the above equations to forms that are more natural for analyzing the case of a CRRA utility specification that we shall use in our example economies. -### Specification with CRRA Utility +### Specification with CRRA utility As in lectures {doc}`optimal taxation without state-contingent debt ` and {doc}`optimal taxation with state-contingent debt `, we assume that the representative agent has utility function @@ -244,7 +244,7 @@ The CRRA utility function is represented in the following class. :load: _static/lecture_specific/amss2/crra_utility.py ``` -## Example Economy +## Example economy We set the following parameter values. @@ -292,7 +292,7 @@ tags: [collapse-20] --- ``` -## Reverse Engineering Strategy +## Reverse engineering strategy We can reverse engineer a value $b_0$ of initial debt due that renders the AMSS measurability constraints not binding from time $t =0$ onward. @@ -337,7 +337,7 @@ state $s_t=s$ from $b(s) = {\frac{x(s)}{u_c(s)}}$ or the matrix equation **Step 7:** At the value of $\Phi$ and the value of $\bar b$ that emerged from step 6, solve equations {eq}`amss2_TS_barg11` and {eq}`eqn_AMSS2_10` jointly for $c_0, b_0$. -## Code for Reverse Engineering +## Code for reverse engineering Here is code to do the calculations for us. @@ -420,7 +420,7 @@ c0, b0 Thus, we have reverse engineered an initial $b0 = -1.038698407551764$ that ought to render the AMSS measurability constraints slack. -## Short Simulation for Reverse-engineered: Initial Debt +## Short simulation for reverse-engineered: initial debt The following graph shows simulations of outcomes for both a Lucas-Stokey economy and for an AMSS economy starting from initial government debt equal to $b_0 = -1.038698407551764$. @@ -477,7 +477,7 @@ Notice how for $t \geq 1$, the tax rate is a constant - so is the par value of g However, output and labor supply are both nontrivial time-invariant functions of the Markov state. -## Long Simulation +## Long simulation The following graph shows the par value of government debt and the flat-rate tax on labor income for a long simulation for our sample economy. @@ -523,7 +523,7 @@ plt.tight_layout() plt.show() ``` -### Remarks about Long Simulation +### Remarks about long simulation As remarked above, after $b_{t+1}(s^t)$ has converged to a constant, the measurability constraints in the AMSS model cease to bind @@ -536,7 +536,7 @@ This leads us to seek an initial value of government debt $b_0$ that renders the We now describe how to find such an initial level of government debt. -## BEGS Approximations of Limiting Debt and Convergence Rate +## BEGS approximations of limiting debt and convergence rate It is useful to link the outcome of our reverse engineering exercise to limiting approximations constructed by BEGS {cite}`BEGS1`. @@ -573,7 +573,7 @@ BEGS interpret random variations in the right side of {eq}`eq_fiscal_risk` as a ${\mathcal R}_\tau(s, s_{-}) {\mathcal B}_{-}$, and - fluctuations in the effective government deficit ${\mathcal X}_t$ -### Asymptotic Mean +### Asymptotic mean BEGS give conditions under which the ergodic mean of ${\mathcal B}_t$ is @@ -607,7 +607,7 @@ Expressing formula {eq}`prelim_formula` in terms of our notation tells us that \hat b = \frac{\mathcal B^*}{\beta E_t u_{c,t+1}} ``` -### Rate of Convergence +### Rate of convergence BEGS also derive the following approximation to the rate of convergence to ${\mathcal B}^{*}$ from an arbitrary initial condition. @@ -619,7 +619,7 @@ BEGS also derive the following approximation to the rate of convergence to ${\m (See the equation above equation (47) in {cite}`BEGS1`) -### Formulas and Code Details +### Formulas and code details For our example, we describe some code that we use to compute the steady state mean and the rate of convergence to it. diff --git a/lectures/amss3.md b/lectures/amss3.md index bbef7f1d..4369e30b 100644 --- a/lectures/amss3.md +++ b/lectures/amss3.md @@ -73,7 +73,7 @@ import matplotlib.pyplot as plt from scipy.optimize import minimize ``` -## The Economy +## The economy As in {doc}`Optimal Taxation without State-Contingent Debt ` and {doc}`Optimal Taxation with State-Contingent Debt `, we assume that the representative agent has utility function @@ -115,7 +115,7 @@ The following Python code sets up the economy :load: _static/lecture_specific/amss2/crra_utility.py ``` -### First and Second Moments +### First and second moments We'll want first and second moments of some key random variables below. @@ -136,7 +136,7 @@ def covariance(x, y, s): return x * y @ u.π[s] - mean(x, s) * mean(y, s) ``` -## Long Simulation +## Long simulation To generate a long simulation we use the following code. @@ -263,7 +263,7 @@ these early observations * early observations are more influenced by the initial value of the par value of government debt than by the ergodic mean of the par value of government debt * much later observations are more influenced by the ergodic mean and are independent of the par value of initial government debt -## Asymptotic Mean and Rate of Convergence +## Asymptotic mean and rate of convergence We apply the results of BEGS {cite}`BEGS1` to interpret @@ -310,7 +310,7 @@ BEGS interpret random variations in the right side of {eq}`eq_fiscal_risk_1` as ${\mathcal R}_\tau(s, s_{-}) {\mathcal B}_{-}$, and - fluctuations in the effective government deficit ${\mathcal X}_t$ -### Asymptotic Mean +### Asymptotic mean BEGS give conditions under which the ergodic mean of ${\mathcal B}_t$ is approximated by @@ -347,7 +347,7 @@ AMSS model should be approximately where mathematical expectations are taken with respect to the ergodic distribution. -### Rate of Convergence +### Rate of convergence BEGS also derive the following approximation to the rate of convergence to ${\mathcal B}^{*}$ from an arbitrary initial condition. @@ -361,13 +361,13 @@ BEGS also derive the following approximation to the rate of convergence to ${\m (See the equation above equation (47) in BEGS {cite}`BEGS1`) -### More Advanced Topic +### More advanced topic The remainder of this lecture is about technical material based on formulas from BEGS {cite}`BEGS1`. The topic involves interpreting and extending formula {eq}`eq_criterion_fiscal_1` for the ergodic mean ${\mathcal B}^*$. -### Chicken and Egg +### Chicken and egg Notice how attributes of the ergodic distribution for ${\mathcal B}_t$ appear on the right side of formula {eq}`eq_criterion_fiscal_1` for approximating the ergodic mean via ${\mathcal B}^*$. @@ -385,7 +385,7 @@ As an example, notice how we used the formula for the mean of ${\mathcal B}$ in * **first** we computed the ergodic distribution using a reverse-engineering construction * **then** we verified that ${\mathcal B}^*$ agrees with the mean of that distribution -### Approximating the Ergodic Mean +### Approximating the ergodic mean BEGS also {cite}`BEGS1` propose an approximation to ${\mathcal B}^*$ that can be computed **without** first approximating the ergodic distribution. @@ -400,7 +400,7 @@ To construct the BEGS approximation to ${\mathcal B}^*$, we just follow steps Here is a step-by-step description of the BEGS {cite}`BEGS1` approximation procedure. -### Step by Step +### Step by step **Step 1:** For a given $\tau$ we compute a vector of values $c_\tau(s), s= 1, 2, \ldots, S$ that satisfy @@ -559,7 +559,7 @@ root(solve_c, np.ones(S), args=(τ, u)) n = c + u.G # Compute labor supply ``` -### Note about Code +### Note about code Remember that in our code $\pi$ is a $3 \times 3$ transition matrix. diff --git a/lectures/arellano.md b/lectures/arellano.md index 8d97f18d..102d65fc 100644 --- a/lectures/arellano.md +++ b/lectures/arellano.md @@ -81,7 +81,7 @@ from numba import njit, prange In this section we describe the main features of the model. -### Output, Consumption and Debt +### Output, consumption and debt A small open economy is endowed with an exogenous stochastically fluctuating potential output stream $\{y_t\}$. @@ -116,7 +116,7 @@ The government is the only domestic actor with access to foreign credit. Because household are averse to consumption fluctuations, the government will try to smooth consumption by borrowing from (and lending to) foreign creditors. -### Asset Markets +### Asset markets The only credit instrument available to the government is a one-period bond traded in international credit markets. @@ -151,7 +151,7 @@ To rule out Ponzi schemes, we also require that $B \geq -Z$ in every period. * $Z$ is chosen to be sufficiently large that the constraint never binds in equilibrium. -### Financial Markets +### Financial markets Foreign creditors @@ -176,7 +176,7 @@ q = \frac{1 - \delta}{1 + r} Next we turn to how the government in effect chooses the default probability $\delta$. -### Government's Decisions +### Government's decisions At each point in time $t$, the government chooses between @@ -195,7 +195,7 @@ But a sovereign default has two consequences: markets. 1. The country loses access to foreign credit markets. -### Reentering International Credit Market +### Reentering international credit market While in a state of default, the economy regains access to foreign credit in each subsequent period with probability $\theta$. @@ -283,7 +283,7 @@ to pin down the bond price function: q(B', y) = \frac{1 - \delta(B', y)}{1 + r} ``` -### Definition of Equilibrium +### Definition of equilibrium An *equilibrium* is diff --git a/lectures/arma.md b/lectures/arma.md index a7718ef1..1371d8bd 100644 --- a/lectures/arma.md +++ b/lectures/arma.md @@ -51,7 +51,7 @@ Every ARMA process can be represented in [linear state space](https://python-int However, ARMA processes have some important structure that makes it valuable to study them separately. -### {index}`Spectral Analysis ` +### {index}`Spectral analysis ` Analysis in the frequency domain is also called spectral analysis. @@ -65,7 +65,7 @@ Having a second representation of this important object The famous *Fourier transform* and its inverse are used to map between the two representations. -### Other Reading +### Other reading For supplementary reading, see @@ -124,7 +124,7 @@ Throughout this lecture, we will work exclusively with zero-mean (i.e., $\mu = 0 The zero-mean assumption costs nothing in terms of generality since working with non-zero-mean processes involves no more than adding a constant. -### Example 1: {index}`White Noise ` +### Example 1: {index}`White noise ` Perhaps the simplest class of covariance stationary processes is the white noise processes. @@ -138,7 +138,7 @@ A process $\{ \epsilon_t \}$ is called a *white noise process* if White noise processes play the role of **building blocks** for processes with more complicated dynamics. (generalized_lps)= -### Example 2: {index}`General Linear Processes ` +### Example 2: {index}`General linear processes ` From the simple building block provided by white noise, we can construct a very flexible family of covariance stationary processes --- the *general linear processes* @@ -170,7 +170,7 @@ By the [Cauchy-Schwartz inequality](https://en.wikipedia.org/wiki/Cauchy%E2%80%9 Evidently, $\gamma(k)$ does not depend on $t$. -### {index}`Wold Representation ` +### {index}`Wold representation ` Remarkably, the class of general linear processes goes a long way towards describing the entire class of zero-mean covariance stationary processes. @@ -268,7 +268,7 @@ The AR(1) can be generalized to an AR($p$) and likewise for the MA(1). Putting all of this together, we get the -### {index}`ARMA ` Processes +### {index}`ARMA ` processes A stochastic process $\{X_t\}$ is called an *autoregressive moving average process*, or ARMA($p,q$), if it can be written as @@ -330,7 +330,7 @@ The sequence $\{\psi_t\}$ can be obtained by a recursive procedure outlined on p The function $t \mapsto \psi_t$ is often called the *impulse response function*. -## {index}`Spectral Analysis ` +## {index}`Spectral analysis ` Autocovariance functions provide a great deal of information about covariance stationary processes. @@ -342,7 +342,7 @@ It turns out that there is an alternative representation of the autocovariance f At times, the spectral density is easier to derive, easier to manipulate, and provides additional intuition. -### {index}`Complex Numbers ` +### {index}`Complex numbers ` Before discussing the spectral density, we invite you to recall the main properties of complex numbers (or {ref}`skip to the next section `). @@ -375,7 +375,7 @@ $$ where $x = r \cos(\omega), y = r \sin(\omega)$, and $\omega = \arctan(y/z)$ or $\tan(\omega) = y/x$. (arma_specd)= -### {index}`Spectral Densities ` +### {index}`Spectral densities ` Let $\{ X_t \}$ be a covariance stationary process with autocovariance function $\gamma$ satisfying $\sum_{k} \gamma(k)^2 < \infty$. @@ -408,7 +408,7 @@ all of $\mathbb R$ --- the proof is an exercise. For this reason, it is standard to plot the spectral density only on the interval $[0, \pi]$. (arma_wnsd)= -### Example 1: {index}`White Noise ` +### Example 1: {index}`White noise ` Consider a white noise process $\{\epsilon_t\}$ with standard deviation $\sigma$. @@ -458,7 +458,7 @@ The proof is elegant and can be found in many places --- see, for example, {cite It's a nice exercise to verify that {eq}`ma1_sd_ed` and {eq}`ar1_sd_ed` are indeed special cases of {eq}`arma_sd`. -### Interpreting the {index}`Spectral Density ` +### Interpreting the {index}`spectral density ` ```{index} single: Spectral Density; interpretation ``` @@ -590,7 +590,7 @@ plt.show() In summary, the spectral density is large at frequencies $\omega$ where the autocovariance function exhibits damped cycles. -### Inverting the Transformation +### Inverting the transformation ```{index} single: Spectral Density; Inverting the Transformation ``` @@ -611,7 +611,7 @@ This is convenient in situations where the spectral density is easier to calcula (For example, the expression {eq}`arma_sd` for the ARMA spectral density is much easier to work with than the expression for the ARMA autocovariance) -### Mathematical Theory +### Mathematical theory ```{index} single: Spectral Density; Mathematical Theory ``` @@ -873,7 +873,7 @@ then `ma_poly` and `ar_poly` should update automatically to reflect these new pa This is achieved in our implementation by using [descriptors](https://python-programming.quantecon.org/python_advanced_features.html#descriptors). -### Computing the Autocovariance Function +### Computing the autocovariance function As discussed above, for ARMA processes the spectral density has a {ref}`simple representation ` that is relatively easy to calculate. diff --git a/lectures/asset_pricing_lph.md b/lectures/asset_pricing_lph.md index 8dcfd275..3e5cf262 100644 --- a/lectures/asset_pricing_lph.md +++ b/lectures/asset_pricing_lph.md @@ -58,7 +58,7 @@ For background and basic concepts about linear least squares projections, see o As a sequel to the material here, please see our lecture [two modifications of mean-variance portfolio theory](https://python-advanced.quantecon.org/black_litterman.html). -## Key Equation +## Key equation We begin with a **key asset pricing equation**: @@ -96,7 +96,7 @@ the stochastic discount factor is unique. In **incomplete markets** models like those illustrated in this lecture [the Aiyagari model](https://python.quantecon.org/aiyagari.html), the stochastic discount factor is not unique. -## Implications of Key Equation +## Implications of key equation We combine key equation {eq}`eq:EMR1` with a remark of Lars Peter Hansen that "asset pricing theory is all about covariances". @@ -166,7 +166,7 @@ $$ (eq:EMR3) Equation {eq}`eq:EMR3` can be rearranged to display important parts of asset pricing theory. -## Expected Return - Beta Representation +## Expected return - beta representation We can obtain the celebrated **expected-return-Beta -representation** for gross return $R^i$ by simply rearranging excess return equation {eq}`eq:EMR3` to become @@ -283,7 +283,7 @@ An asset with an $R^i$ that is **low** when consumption growth is **low** has $\ -## Mean-Variance Frontier +## Mean-variance frontier Now we'll derive the celebrated **mean-variance frontier**. @@ -421,7 +421,7 @@ $$ This is a measure of the part of the risk in $R^j$ that is not priced because it is uncorrelated with the stochastic discount factor and so can be diversified away (i.e., averaged out to zero by holding a diversified portfolio). -## Sharpe Ratios and the Price of Risk +## Sharpe ratios and the price of risk An asset's **Sharpe ratio** is defined as @@ -441,7 +441,7 @@ The ratio $\frac{\sigma(m)}{E m} $ is often called the **market price of risk**. Evidently it equals the maximum Sharpe ratio for any asset or portfolio of assets. -## Mathematical Structure of Frontier +## Mathematical structure of frontier The mathematical structure of the mean-variance frontier described by inequality {eq}`eq:ERM6` implies that @@ -479,7 +479,7 @@ $$ (eq:EMR7) +++ -## Multi-factor Models +## Multi-factor models The single-beta representation {eq}`eq:EMR7` is a special case of the multi-factor model @@ -514,7 +514,7 @@ As a reminder, model objects are interpreted as follows: * $\lambda_{a}$ is the price of exposure to risk factor $f_a$ -## Empirical Implementations +## Empirical implementations We briefly describe empirical implementations of multi-factor generalizations of the single-factor model described above. diff --git a/lectures/black_litterman.md b/lectures/black_litterman.md index 44cc29c6..807c1ee9 100644 --- a/lectures/black_litterman.md +++ b/lectures/black_litterman.md @@ -88,7 +88,7 @@ import matplotlib.pyplot as plt from numba import jit ``` -## Mean-Variance Portfolio Choice +## Mean-variance portfolio choice A risk-free security earns one-period net return $r_f$. @@ -145,7 +145,7 @@ which implies the following design of a risky portfolio: w = (\delta \Sigma)^{-1} \mu ``` -## Estimating Mean and Variance +## Estimating mean and variance The key inputs into the portfolio choice model {eq}`risky-portfolio` are @@ -158,7 +158,7 @@ squares; that amounts to estimating $\mu$ by a sample mean of excess returns and estimating $\Sigma$ by a sample covariance matrix. -## Black-Litterman Starting Point +## Black-Litterman starting point When estimates of $\mu$ and $\Sigma$ from historical sample means and covariances have been combined with **plausible** values @@ -329,7 +329,7 @@ plt.legend(numpoints=1) plt.show() ``` -## Adding Views +## Adding views Black and Litterman start with a baseline customer who asserts that he or she shares the **market's views**, which means that he or she @@ -443,7 +443,7 @@ def BL_plot(τ): BL_plot(τ) ``` -## Bayesian Interpretation +## Bayesian interpretation Consider the following Bayesian interpretation of the Black-Litterman recommendation. @@ -487,7 +487,7 @@ Hence, the Black-Litterman recommendation is consistent with the Bayes update of the prior over the mean excess returns in light of the realized average excess returns on the market. -## Curve Decolletage +## Curve decolletage Consider two independent "competing" views on the excess market returns @@ -734,7 +734,7 @@ def decolletage(λ): decolletage(λ) ``` -## Black-Litterman Recommendation as Regularization +## Black-Litterman recommendation as regularization First, consider the OLS regression @@ -883,7 +883,7 @@ So the Black-Litterman procedure results in a recommendation that is a compromise between the conservative market portfolio and the more extreme portfolio that is implied by estimated "personal" views. -## A Robust Control Operator +## A robust control operator The Black-Litterman approach is partly inspired by the econometric insight that it is easier to estimate covariances of excess returns than @@ -1016,7 +1016,7 @@ $$ \frac{v'v}{2} = \frac{1}{2\theta^2} w' C C' w $$ -## A Robust Mean-Variance Portfolio Model +## A robust mean-variance portfolio model According to criterion {eq}`choice-problem`, the mean-variance portfolio choice problem chooses $w$ to maximize @@ -1150,7 +1150,7 @@ variances". That is, we need significantly more data to obtain a given precision of the mean estimate than for our variance estimate. -## Special Case -- IID Sample +## Special case -- IID sample We start our analysis with the benchmark case of IID data. @@ -1187,7 +1187,7 @@ $$ We are interested in how this (asymptotic) relative rate of convergence changes as increasing sampling frequency puts dependence into the data. -## Dependence and Sampling Frequency +## Dependence and sampling frequency To investigate how sampling frequency affects relative rates of convergence, we assume that the data are generated by a mean-reverting @@ -1270,7 +1270,7 @@ ax.set(title=r'Autocorrelation functions, $\Gamma_h(n)$', plt.show() ``` -## Frequency and the Mean Estimator +## Frequency and the mean estimator Consider again the AR(1) process generated by discrete sampling with frequency $h$. Assume that we have a sample of size $N$ and diff --git a/lectures/calvo.md b/lectures/calvo.md index 9c6e72ef..a850f5a5 100644 --- a/lectures/calvo.md +++ b/lectures/calvo.md @@ -93,7 +93,7 @@ import pandas as pd from IPython.display import display, Math ``` -## Model Components +## Model components There is no uncertainty. @@ -222,7 +222,7 @@ $$ U(-\alpha \theta_t) = u_0 + u_1 (-\alpha \theta_t) -\frac{u_2}{2}(-\alpha \theta_t)^2 . $$ (eq_old5a) -## Friedman's Optimal Rate of Deflation +## Friedman's optimal rate of deflation According to {eq}`eq_old5a`, the ``bliss level`` of real balances is $\frac{u_1}{u_2}$ and the inflation rate that attains it is @@ -246,7 +246,7 @@ where $\theta^*$ is given by equation {eq}`eq:Friedmantheta`. Milton Friedman assumed that the taxes that government imposes to collect money at rate $\mu_t$ do not distort economic decisions, e.g., they are lump-sum taxes. -## Calvo's Distortion +## Calvo's distortion The starting point of Calvo {cite}`Calvo1978` and Chang {cite}`chang1998credible` is that lump sum taxes are not available. @@ -352,7 +352,7 @@ A theory of government decisions will make $\vec \mu$ endogenous, i.e., a theoretical **output** instead of an **input**. -### Intertemporal Aspects +### Intertemporal aspects Criterion function {eq}`eq_old7` and the constraint system {eq}`eq_old4` exhibit the following structure: @@ -373,7 +373,7 @@ We'll study outcomes under a Ramsey timing protocol. We'll also study outcomes under other timing protocols. -## Three Timing Protocols +## Three timing protocols We consider three models of government policy making that differ in @@ -427,7 +427,7 @@ The relationship between outcomes in the first (Ramsey) timing protocol and th ``` -## Note on Dynamic Programming Squared +## Note on dynamic programming squared We'll begin with the timing protocol associated with a Ramsey plan and deploy an application of what we nickname **dynamic programming squared**. @@ -443,7 +443,7 @@ Thus, two Bellman equations appear: A value $\theta$ from one Bellman equation appears as an argument of a second Bellman equation for another value $v$. -## A Ramsey Planner +## A Ramsey planner A Ramsey planner chooses $\{\mu_t, \theta_t\}_{t=0}^\infty$ to maximize {eq}`eq_old7` @@ -616,7 +616,7 @@ $$ \theta_0 = \theta_0^R = - \frac{P_{21}}{P_{22}} $$ -## Representation of Ramsey Plan +## Representation of Ramsey plan The preceding calculations indicate that we can represent a Ramsey plan $\vec \mu$ recursively with the following system created in the spirit of Chang {cite}`chang1998credible`: @@ -716,7 +716,7 @@ Thus, in our context, time-variation of $\vec \mu$ chosen by a Ramsey planner is the telltale sign of the Ramsey plan's **time inconsistency**. -## Constrained-to-Constant-Growth-Rate Ramsey Plan +## Constrained-to-constant-growth-rate Ramsey plan We can use brute force to create a government plan that **is** time consistent, i.e., that is a time-invariant function of time. @@ -759,7 +759,7 @@ Time-variation of $\vec \mu$ chosen by a Ramsey planner Obviously, our constrained-to-constant $\mu$ Ramsey planner **must** must choose a plan that is time consistent. -## Markov Perfect Governments +## Markov perfect governments To generate an alternative model of time-consistent government decision making, we assume another timing protocol. @@ -860,7 +860,7 @@ Under the Markov perfect timing protocol * we equate $\mu_t = \mu$ only *after* we have computed a time $t$ government's first-order condition for $\mu_t$. (compute_lq)= -## Outcomes under Three Timing Protocols +## Outcomes under three timing protocols We want to compare outcome sequences $\{ \theta_t,\mu_t \}$ under three timing protocols associated with @@ -1168,7 +1168,7 @@ In the above graph, notice that $\theta^* < \theta_\infty^R < \theta^{CR} < \the In some subsequent calculations, we'll use our Python code to study how gaps between these outcome vary depending on parameters such as the cost parameter $c$ and the discount factor $\beta$. -## Ramsey Planner's Value Function +## Ramsey planner's value function The next code plots the Ramsey Planner's value function $J(\theta)$ as well as the value function of a constrained Ramsey planner who must choose a constant @@ -1349,7 +1349,7 @@ In the above figure, notice that -## Perturbing Model Parameters +## Perturbing model parameters Now let's present some graphs that teach us how outcomes change when we assume different values of $\beta$ @@ -1542,7 +1542,7 @@ in interesting ways. We leave it to the reader to explore consequences of other constellations of parameter values. -### Implausibility of Ramsey Plan +### Implausibility of Ramsey plan Many economists regard a time inconsistent plan as implausible because they question the plausibility of timing protocol in which a plan for setting a sequence of policy variables is chosen once-and-for-all at time $0$. @@ -1552,7 +1552,7 @@ economists. * A Markov perfect equilibrium plan is constructed to insure that a sequence of government policymakers who choose sequentially do not want to deviate from it. -### Ramsey Plan Strikes Back +### Ramsey plan strikes back Research by Abreu {cite}`Abreu`, Chari and Kehoe {cite}`chari1990sustainable` {cite}`stokey1989reputation`, and Stokey {cite}`Stokey1991` described conditions under which a Ramsey plan can be rescued from the complaint that it is not credible. diff --git a/lectures/calvo_abreu.md b/lectures/calvo_abreu.md index 5096641c..44a1496e 100644 --- a/lectures/calvo_abreu.md +++ b/lectures/calvo_abreu.md @@ -55,7 +55,7 @@ our timing protocol. -## Model Components +## Model components We'll start with a brief review of the setup. @@ -133,7 +133,7 @@ makes timing protocols matter for modeling optimal government policies. Quantecon lecture {doc}`calvo` used this insight to simplify analysis of alternative government policy problems. -## Another Timing Protocol +## Another timing protocol The Quantecon lecture {doc}`calvo` considered three models of government policy making that differ in @@ -182,7 +182,7 @@ In this version of our model - at each $t$, the government chooses $\mu_t$ to maximize a continuation discounted utility. -### Government Decisions +### Government decisions $\vec \mu$ is chosen by a sequence of government decision makers, one for each $t \geq 0$. @@ -214,7 +214,7 @@ for each $t \geq 0$: expect an associated $\theta_0^A$ for $t+1$. Here $\vec \mu^A = \{\mu_j^A \}_{j=0}^\infty$ is an alternative government plan to be described below. -### Temptation to Deviate from Plan +### Temptation to deviate from plan The government's one-period return function $s(\theta,\mu)$ described in equation {eq}`eq_old6` in quantecon lecture {cite}`Calvo1978` has the property that for all @@ -240,7 +240,7 @@ If the government at $t$ is to resist the temptation to raise its current payoff, it is only because it forecasts adverse consequences that its setting of $\mu_t$ would bring for continuation government payoffs via alterations in the private sector's expectations. -## Sustainable or Credible Plan +## Sustainable or credible plan We call a plan $\vec \mu$ **sustainable** or **credible** if at each $t \geq 0$ the government chooses to confirm private @@ -294,7 +294,7 @@ import matplotlib.pyplot as plt import pandas as pd ``` -### Abreu's Self-Enforcing Plan +### Abreu's self-enforcing plan A plan $\vec \mu^A$ (here the superscipt $A$ is for Abreu) is said to be **self-enforcing** if @@ -359,7 +359,7 @@ agents' expectation. We shall use a construction featured in Abreu ({cite}`Abreu`) to construct a self-enforcing plan with low time $0$ value. -### Abreu's Carrot-Stick Plan +### Abreu's carrot-stick plan {cite}`Abreu` invented a way to create a self-enforcing plan with a low initial value. @@ -518,7 +518,7 @@ Let's create an instance of ChangLQ with the following parameters: clq = ChangLQ(β=0.85, c=2) ``` -### Example of Self-Enforcing Plan +### Example of self-enforcing plan The following example implements an Abreu stick-and-carrot plan. @@ -634,7 +634,7 @@ def check_ramsey(clq, T=1000): check_ramsey(clq) ``` -### Recursive Representation of a Sustainable Plan +### Recursive representation of a sustainable plan We can represent a sustainable plan recursively by taking the continuation value $v_t$ as a state variable. @@ -665,7 +665,7 @@ depends on whether the government at $t$ confirms the representative agent's expectations by setting $\mu_t$ equal to the recommended value $\hat \mu_t$, or whether it disappoints those expectations. -## Whose Plan is It? +## Whose plan is it? A credible government plan $\vec \mu$ plays multiple roles. diff --git a/lectures/calvo_machine_learn.md b/lectures/calvo_machine_learn.md index 12014ba8..9e10dcbf 100644 --- a/lectures/calvo_machine_learn.md +++ b/lectures/calvo_machine_learn.md @@ -72,7 +72,7 @@ We pose some of those questions at the end of this lecture and answer them b Human intelligence, not the ``artificial intelligence`` deployed in our machine learning approach, is a key input into choosing which regressions to run. -## The Model +## The model We study a linear-quadratic version of a model that Guillermo Calvo {cite}`Calvo1978` used to illustrate the **time inconsistency** of optimal government plans. @@ -93,7 +93,7 @@ The model combines ideas from papers by Cagan {cite}`Cagan`, {cite}`sargent1973 -## Model Components +## Model components There is no uncertainty. @@ -239,7 +239,7 @@ $$ -## Parameters and Variables +## Parameters and variables **Parameters:** @@ -265,7 +265,7 @@ $$ -### Basic Objects +### Basic objects To prepare the way for our calculations, we'll remind ourselves of the mathematical objects in play. @@ -321,7 +321,7 @@ An optimal government plan under this timing protocol is an example of what is Notice that while the government is in effect choosing a bivariate **time series** $(\vec mu, \vec \theta)$, the government's problem is **static** in the sense that it chooses treats that time-series as a single object to be chosen at a single point in time. -## Approximation and Truncation parameter $T$ +## Approximation and truncation parameter $T$ We anticipate that under a Ramsey plan the sequences $\{\theta_t\}$ and $\{\mu_t\}$ both converge to stationary values. @@ -392,7 +392,7 @@ $$ where $\tilde \theta_t, \ t = 0, 1, \ldots , T-1$ satisfies formula (1). -## A Gradient Descent Algorithm +## A gradient descent algorithm We now describe code that maximizes the criterion function {eq}`eq:Ramseyvalue` subject to equations {eq}`eq:inflation101` by choice of the truncated vector $\tilde \mu$. @@ -689,7 +689,7 @@ compute_V(clq.μ_series, β=0.85, c=2) -### Restricting $\mu_t = \bar \mu$ for all $t$ +### Restricting $\mu_t = \bar \mu$ for all $t$ We take a brief detour to solve a restricted version of the Ramsey problem defined above. @@ -729,7 +729,7 @@ V_CR compute_V(jnp.array([clq.μ_CR]), β=0.85, c=2) ``` -## A More Structured ML Algorithm +## A more structured ML algorithm By thinking about the mathematical structure of the Ramsey problem and using some linear algebra, we can simplify the problem that we hand over to a ``machine learning`` algorithm. @@ -1063,7 +1063,7 @@ the limit $\bar \mu$ of $\mu_t$ as $t \rightarrow +\infty$. This pattern reflects how formula {eq}`eq_grad_old3` makes $\theta_t$ be a weighted average of future $\mu_t$'s. -## Continuation Values +## Continuation values For subsquent analysis, it will be useful to compute a sequence $\{v_t\}_{t=0}^T$ of what we'll call ``continuation values`` along a Ramsey plan. @@ -1163,7 +1163,7 @@ time-less perspective." A more descriptive phrase is "the value of the worst con ``` -## Adding Some Human Intelligence +## Adding some human intelligence We have used our machine learning algorithms to compute a Ramsey plan. @@ -1351,7 +1351,7 @@ Evidently, continuation values $v_t > V^{CR}$ for $t=0, 1, 2$ while $v_t < V^{CR -## What has Machine Learning Taught Us? +## What has machine learning taught us? Our regressions tells us that along the Ramsey outcome $\vec \mu^R, \vec \theta^R$, the linear function diff --git a/lectures/cattle_cycles.md b/lectures/cattle_cycles.md index f6a55168..fa835519 100644 --- a/lectures/cattle_cycles.md +++ b/lectures/cattle_cycles.md @@ -51,7 +51,7 @@ from quantecon import DLE from math import sqrt ``` -## The Model +## The model The model features a static linear demand curve and a "time-to-grow" structure for cattle. @@ -107,7 +107,7 @@ Demand for beef is government by $c_t = a_0 - a_1p_t + \tilde d_t$ where $\tilde d_t$ is a stochastic process with mean zero, representing a demand shifter. -## Mapping into HS2013 Framework +## Mapping into HS2013 framework ### Preferences diff --git a/lectures/chang_credible.md b/lectures/chang_credible.md index 42cc9156..7d37c2a8 100644 --- a/lectures/chang_credible.md +++ b/lectures/chang_credible.md @@ -86,7 +86,7 @@ import polytope import matplotlib.pyplot as plt ``` -## The Setting +## The setting We begin by reviewing the set up deployed in {doc}`competitive equilibria in the Chang model `. @@ -134,7 +134,7 @@ In competitive equilibrium, the price of money sequence $\vec q$ clears markets, thereby reconciling decisions of the government and the representative household. -### The Household’s Problem +### The household's problem A representative household faces a nonnegative value of money sequence $\vec q$ and sequences $\vec y, \vec x$ of income and total @@ -239,7 +239,7 @@ absolute value of tax revenues. The government chooses a competitive equilibrium that maximizes {eq}`eqn_chang1`. -### Within-period Timing Protocol +### Within-period timing protocol For the results in this lecture, the *timing* of actions within a period is important because of the incentives that it activates. @@ -262,7 +262,7 @@ This timing will shape the incentives confronting the government at each history that are to be incorporated in the construction of the $\tilde D$ operator below. -### Household’s Problem +### Household's problem Given $M_{-1}$ and $\{q_t\}_{t=0}^\infty$, the household’s problem is @@ -323,7 +323,7 @@ in constructing a class of competitive equilibria that have a recursive represen A closely related observation pervaded the analysis of Stackelberg plans in {doc}`dynamic Stackelberg problems ` and {doc}`the Calvo model `. -### Competitive Equilibrium +### Competitive equilibrium **Definition:** @@ -342,7 +342,7 @@ $(\vec c, \vec m, \vec y)$ are said to be a *competitive equilibrium* if * The government budget constraint is satisfied. * Given $\vec q, \vec x, \vec y$, $(\vec c, \vec m)$ solves the household’s problem. -### A Credible Government Policy +### A credible government policy Chang works with @@ -423,7 +423,7 @@ the private sector. For a credible government plan, we the two-dimensional state vector $(w_t, \theta_t)$ encodes history dependence. -### Sustainable Plans +### Sustainable plans A government strategy $\sigma$ and an allocation rule $\alpha$ are said to constitute a *sustainable plan* (SP) if. @@ -591,7 +591,7 @@ sustainable outcome: \end{aligned} $$ -## Calculating the Set of Sustainable Promise-Value Pairs +## Calculating the set of sustainable promise-value pairs Above we defined the $\tilde D(Z)$ operator as {eq}`chang_operator`. @@ -806,7 +806,7 @@ tags: [collapse-20] --- ``` -### Comparison of Sets +### Comparison of sets The set of $(w, \theta)$ associated with sustainable plans is smaller than the set of $(w, \theta)$ pairs associated with competitive equilibria, since the additional diff --git a/lectures/chang_ramsey.md b/lectures/chang_ramsey.md index 760f73b7..97571036 100644 --- a/lectures/chang_ramsey.md +++ b/lectures/chang_ramsey.md @@ -74,7 +74,7 @@ import polytope import matplotlib.pyplot as plt ``` -### The Setting +### The setting First, we introduce some notation. @@ -127,7 +127,7 @@ $t \geq 0$. ## Decisions -### The Household’s Problem +### The household's problem A representative household faces a nonnegative value of money sequence $\vec q$ and sequences $\vec y, \vec x$ of income and total @@ -306,7 +306,7 @@ large distorting tax collections. To promote the welfare increasing effects of high real balances, the government wants to induce *gradual deflation*. -### Household’s Problem +### Household's problem Given $M_{-1}$ and $\{q_t\}_{t=0}^\infty$, the household’s problem is @@ -372,7 +372,7 @@ in constructing a class of competitive equilibria that have a recursive represen A closely related observation pervaded the analysis of Stackelberg plans in lecture {doc}`dynamic Stackelberg problems `. -## Competitive Equilibrium +## Competitive equilibrium **Definition:** @@ -391,7 +391,7 @@ $(\vec c, \vec m, \vec y)$ are said to be a *competitive equilibrium* if * The government budget constraint is satisfied. * Given $\vec q, \vec x, \vec y$, $(\vec c, \vec m)$ solves the household’s problem. -## Inventory of Objects in Play +## Inventory of objects in play Chang constructs the following objects @@ -616,7 +616,7 @@ This property allows Chang to compute $\Omega$ as the limit of iterations on $B$ provided that iterations begin from a sufficiently large initial set. -### Some Useful Notation +### Some useful notation Let $\vec h^t = (h_0, h_1, \ldots, h_t)$ denote a history of inverse money creation rates with time $t$ component @@ -679,7 +679,7 @@ $h_t \in CE_\pi^0$, the continuations of $\sigma$ and $\alpha$ after $(\vec h^{t-1},h_t)$ induce a competitive equilibrium sequence. -### Another Operator +### Another operator At this point it is convenient to introduce another operator that can be used to compute a Ramsey plan. @@ -773,7 +773,7 @@ As a very useful by-product, the algorithm that finds the largest fixed point $S = D(S)$ also produces the Ramsey plan, its value $w$, and the associated competitive equilibrium. -## Calculating all Promise-Value Pairs in CE +## Calculating all promise-value pairs in CE Above we have defined the $D(Z)$ operator as: @@ -970,7 +970,7 @@ ch2.solve_sustainable() plot_competitive(ch2) ``` -## Solving a Continuation Ramsey Planner's Bellman Equation +## Solving a continuation Ramsey planner's Bellman equation In this section we solve the Bellman equation confronting a **continuation Ramsey planner**. @@ -1131,7 +1131,7 @@ for model in (ch1, ch2): plt.show() ``` -### Next Steps +### Next steps In {doc}`Credible Government Policies in Chang Model ` we shall find a subset of competitive equilibria that are **sustainable** diff --git a/lectures/classical_filtering.md b/lectures/classical_filtering.md index c71b8cbf..75267d9a 100644 --- a/lectures/classical_filtering.md +++ b/lectures/classical_filtering.md @@ -72,7 +72,7 @@ import numpy as np Useful references include {cite}`Whittle1963`, {cite}`HanSar1980`, {cite}`Orfanidisoptimum1988`, {cite}`Athanasios1991`, and {cite}`Muth1960`. -## Finite Dimensional Prediction +## Finite dimensional prediction Let $(x_1, x_2, \ldots, x_T)^\prime = x$ be a $T \times 1$ vector of random variables with mean $\mathbb{E} x = 0$ and covariance matrix $\mathbb{E} xx^\prime = V$. @@ -414,7 +414,7 @@ The last row of $L^{-1}$ gives the approximate Wold moving average coefficients. This method can readily be generalized to multivariate systems. (fdcp)= -## Combined Finite Dimensional Control and Prediction +## Combined finite dimensional control and prediction Consider the finite-dimensional control problem, maximize @@ -496,7 +496,7 @@ U \bar y = L^{-1} \tilde U^{-1} \right] $$ -## Infinite Horizon Prediction and Filtering Problems +## Infinite horizon prediction and filtering problems It is instructive to compare the finite-horizon formulas based on linear algebra decompositions of finite-dimensional covariance matrices with classic formulas for infinite horizon and infinite history prediction and control problems. @@ -556,7 +556,7 @@ The **linear least squares filtering problem** is to find a $b\,(L) = \sum^\inft Interesting versions of these problems related to the permanent income theory were studied by {cite}`Muth1960`. -### Problem Formulation +### Problem formulation These problems are solved as follows. diff --git a/lectures/coase.md b/lectures/coase.md index 97f2c379..bc879271 100644 --- a/lectures/coase.md +++ b/lectures/coase.md @@ -52,7 +52,7 @@ import matplotlib.pyplot as plt from scipy.optimize import fminbound ``` -### Why Firms Exist +### Why firms exist On top of asking a deep and fascinating question, Coase also supplied an illuminating answer: firms exist because of transaction costs. @@ -78,7 +78,7 @@ Making this agreement is much easier than trying to map every task out in advanc So agent A decides to hire agent B and a firm of nontrivial size appears, due to transaction costs. -### A Trade-Off +### A trade-off Actually, we haven't yet come to the heart of Coase's investigation. @@ -116,7 +116,7 @@ Here's a summary of our discussion: * But as they get large, in-house operations become costly due to diminishing returns to management. * The size of firms is determined by balancing these effects, thereby equalizing the marginal costs of each form of operation. -### A Quantitative Interpretation +### A quantitative interpretation Coases ideas were expressed verbally, without any mathematics. @@ -128,7 +128,7 @@ In doing so we'll add a bit more structure than Coase did, but this price will b Our exposition is based on {cite}`kikuchi2018span`. -## The Model +## The model The model we study involves production of a single unit of a final good. @@ -216,7 +216,7 @@ filling the same role in the production chain. Profits are never negative in equilibrium because firms can freely exit. -### Informal Definition of Equilibrium +### Informal definition of equilibrium An equilibrium in this setting is an allocation of firms and a price function such that @@ -224,7 +224,7 @@ An equilibrium in this setting is an allocation of firms and a price function su 1. no firm in the production chain has an incentive to deviate, and 1. no inactive firms can enter and extract positive profits -### Formal Definition of Equilibrium +### Formal definition of equilibrium Let's make this definition more formal. @@ -273,11 +273,11 @@ This price-allocation pair is called an **equilibrium** for the production chain The rationale behind these conditions was given in our informal definition of equilibrium above. -## Existence, Uniqueness and Computation of Equilibria +## Existence, uniqueness and computation of equilibria We have defined an equilibrium but does one exist? Is it unique? And, if so, how can we compute it? -### A Fixed Point Method +### A fixed point method To address these questions, we introduce the operator $T$ mapping a nonnegative function $p$ on $[0, 1]$ to $Tp$ via @@ -370,7 +370,7 @@ p^*(s) = From this equation, it is clear that so profits are zero for all incumbent firms. -### Marginal Conditions +### Marginal conditions We can develop some additional insights on the behavior of firms by examining marginal conditions associated with the equilibrium. diff --git a/lectures/cons_news.md b/lectures/cons_news.md index c1cf4034..56fbf746 100644 --- a/lectures/cons_news.md +++ b/lectures/cons_news.md @@ -102,7 +102,7 @@ This lecture can be regarded as an introduction to **invertibility** issues th the analysis of **fiscal foresight** by Eric Leeper, Todd Walker, and Susan Yang {cite}`Leeper_Walker_Yang`, as well as in chapter 4 of {cite}`sargent1991observable`. -## Two Representations of One Nonfinancial Income Process +## Two representations of one nonfinancial income process We study consequences of endowing a consumer with one of two alternative representations for the change @@ -264,7 +264,7 @@ and $\Sigma = (1-\beta^2) \sigma_\epsilon^2$. Alternatively, we can obtain these formulas via the classical filtering theory described in {doc}`this lecture `. -## News Shocks and Less Informative Shocks +## News shocks and less informative shocks Representation {eq}`eqn_1` is cast in terms of a **news shock** $\epsilon_{t+1}$ that represents a shock to nonfinancial income @@ -356,7 +356,7 @@ for representation {eq}`eqn_2` is $d_a(\beta) = \frac{1 -\beta^2}{1 -\beta } = (1 + \beta)$, another fact that will be important below. -## Representation of $\epsilon_t$ Shock in Terms of Future $y_t$ +## Representation of $\epsilon_t$ shock in terms of future $y_t$ Notice that reprentation {eq}`eqn_1`, namely, $y_{t+1} - y_t = -\beta^{-1} \epsilon_t + \epsilon_{t+1}$ implies the linear difference equation @@ -382,7 +382,7 @@ $$ Thus, $\epsilon_t$ **exactly** reveals the gap between $y_t$ and $E [ y_t | y^t_+]$. -## Representation in Terms of $a_t$ Shocks +## Representation in terms of $a_t$ shocks Next notice that representation {eq}`eqn_2`, namely, $y_{t+1} - y_t = - \beta a_t + a_{t+1}$ implies the linear difference @@ -405,7 +405,7 @@ $$ E [ y_{t+1} | y^t ] = (1-\beta) \sum_{j=0}^\infty \beta^j y_{t-j} $$ -## Permanent Income Consumption-Smoothing Model +## Permanent income consumption-smoothing model When we computed optimal consumption-saving policies for our two representations {eq}`eqn_1` and {eq}`eqn_2` by using formulas obtained with the difference equation @@ -455,7 +455,7 @@ the temporary part. The behavior of the better informed consumer sharply illustrates the behavior predicted in a classic Ricardian equivalence experiment. -## State Space Representations +## State space representations We now cast our representations {eq}`eqn_1` and {eq}`eqn_2`, respectively, in terms of the following two state space systems: @@ -811,7 +811,7 @@ plt.title("innovations representation") plt.legend() ``` -## Simulating Income Process and Two Associated Shock Processes +## Simulating income process and two associated shock processes We now form a **single** $\{y_t\}_{t=0}^T$ realization that we will use to simulate decisions associated @@ -847,7 +847,7 @@ The above steps implement the experiment of comparing decisions made by two consumers having **identical** incomes at each date but at each date having **different** information about their future incomes. -## Calculating Innovations in Another Way +## Calculating innovations in another way Here we use formula {eq}`eqn_3` above to compute $a_{t+1}$ as a function of the history @@ -869,7 +869,7 @@ $$ We can verify that we recover the same $\{a_t\}$ sequence computed earlier. -## Another Invertibility Issue +## Another invertibility issue This {doc}`quantecon lecture ` contains another example of a shock-invertibility issue that is endemic to the LQ permanent income or consumption smoothing model. diff --git a/lectures/discrete_dp.md b/lectures/discrete_dp.md index 96581d7d..845cbaed 100644 --- a/lectures/discrete_dp.md +++ b/lectures/discrete_dp.md @@ -68,7 +68,7 @@ from quantecon import compute_fixed_point from quantecon.markov import DiscreteDP ``` -### How to Read this Lecture +### How to read this lecture We use dynamic programming many applied lectures, such as @@ -157,7 +157,7 @@ The aim is to find an optimal policy, in the sense of one that maximizes {eq}`dp Let's now step through these ideas more carefully. -### Formal Definition +### Formal definition Formally, a discrete dynamic program consists of the following components: @@ -212,7 +212,7 @@ Notice that we're not really distinguishing between functions from $S$ to $\math This is natural because they are in one to one correspondence. -### Value and Optimality +### Value and optimality Let $v_{\sigma}(s)$ denote the discounted sum of expected reward flows from policy $\sigma$ when the initial state is $s$. @@ -251,7 +251,7 @@ $$ As discussed in detail below, optimal policies are precisely those that are $v^*$-greedy. -### Two Operators +### Two operators It is useful to define the following operators: @@ -293,7 +293,7 @@ For any policy $\sigma$, its value $v_{\sigma}$ is the unique fixed point of $T_ For proofs of these results and those in the next section, see, for example, [EDTC](http://johnstachurski.net/edtc.html), chapter 10. -### The Bellman Equation and the Principle of Optimality +### The Bellman equation and the principle of optimality The main principle of the theory of dynamic programming is that @@ -321,7 +321,7 @@ $$ \qquad (s \in S) $$ -## Solving Discrete DPs +## Solving discrete DPs Now that the theory has been set out, let's turn to solution methods. @@ -335,7 +335,7 @@ It implements the three most important solution methods for discrete dynamic pro Let's briefly review these algorithms and their implementation. -### Value Function Iteration +### Value function iteration Perhaps the most familiar method for solving all manner of dynamic programs is value function iteration. @@ -345,7 +345,7 @@ Hence, iterative application of $T$ to any initial function $v^0 \colon S \to \m The details of the algorithm can be found in {ref}`the appendix `. -### Policy Function Iteration +### Policy function iteration This routine, also known as Howard's policy improvement algorithm, exploits more closely the particular structure of a discrete DP problem. @@ -360,7 +360,7 @@ In the current setting, policy iteration computes an exact optimal policy in fin The details of the algorithm can be found in {ref}`the appendix `. -### Modified Policy Function Iteration +### Modified policy function iteration Modified policy iteration replaces the policy evaluation step in policy iteration with "partial policy evaluation". @@ -371,7 +371,7 @@ This approach can be useful when the state space is very large and the linear sy The details of the algorithm can be found in {ref}`the appendix `. (ddp_eg_gm)= -## Example: A Growth Model +## Example: A growth model Let's consider a simple consumption-saving model. @@ -396,7 +396,7 @@ $$ The discount factor is $\beta \in [0, 1)$. -### Discrete DP Representation +### Discrete DP representation We want to represent this model in the format of a discrete dynamic program. @@ -422,7 +422,7 @@ Q(s, a, s') := \end{cases} ``` -### Defining a DiscreteDP Instance +### Defining a DiscreteDP instance This information will be used to create an instance of DiscreteDP by passing the following information @@ -567,7 +567,7 @@ If we look at the bar graph we can see the rightward shift in probability mass :scale: 70% ``` -### State-Action Pair Formulation +### State-action pair formulation The `DiscreteDP` class in fact, provides a second interface to set up an instance. @@ -714,7 +714,7 @@ Here we intensively vectorized the operations on arrays to simplify the code. As [noted](https://python-programming.quantecon.org/need_for_speed.html#numba-p-c-vectorization), however, vectorization is memory consumptive, and it can be prohibitively so for grids with large size. -### Solving the Model +### Solving the model Solve the dynamic optimization problem: @@ -810,11 +810,11 @@ The value function is monotone: (np.diff(v) > 0).all() ``` -### Comparison of the Solution Methods +### Comparison of the solution methods Let us solve the problem with the other two methods. -#### Value Iteration +#### Value iteration ```{code-cell} python3 ddp.epsilon = 1e-4 @@ -827,7 +827,7 @@ res1.num_iter np.array_equal(σ, res1.sigma) ``` -#### Modified Policy Iteration +#### Modified policy iteration ```{code-cell} python3 res2 = ddp.solve(method='modified_policy_iteration') @@ -838,7 +838,7 @@ res2.num_iter np.array_equal(σ, res2.sigma) ``` -#### Speed Comparison +#### Speed comparison ```{code-cell} python3 %timeit ddp.solve(method='value_iteration') @@ -849,11 +849,11 @@ np.array_equal(σ, res2.sigma) As is often the case, policy iteration and modified policy iteration are much faster than value iteration. -### Replication of the Figures +### Replication of the figures Using `DiscreteDP` we replicate the figures shown in the lecture. -#### Convergence of Value Iteration +#### Convergence of value iteration Let us first visualize the convergence of the value iteration algorithm as in the lecture, where we use `ddp.bellman_operator` implemented as @@ -905,7 +905,7 @@ for i, n in enumerate((2, 4, 6)): plt.show() ``` -#### Dynamics of the Capital Stock +#### Dynamics of the capital stock Finally, let us work on [Exercise 2](https://python.quantecon.org/optgrowth.html#exercises), where we plot @@ -942,7 +942,7 @@ plt.show() ``` (ddp_algorithms)= -## Appendix: Algorithms +## Appendix: algorithms This appendix covers the details of the solution algorithms implemented for `DiscreteDP`. @@ -951,7 +951,7 @@ We will make use of the following notions of approximate optimality: * For $\varepsilon > 0$, $v$ is called an $\varepsilon$-approximation of $v^*$ if $\lVert v - v^*\rVert < \varepsilon$. * A policy $\sigma \in \Sigma$ is called $\varepsilon$-optimal if $v_{\sigma}$ is an $\varepsilon$-approximation of $v^*$. -### Value Iteration +### Value iteration The `DiscreteDP` value iteration method implements value function iteration as follows @@ -970,7 +970,7 @@ Given $\varepsilon > 0$, the value iteration algorithm (While not explicit, in the actual implementation each algorithm is terminated if the number of iterations reaches `iter_max`) -### Policy Iteration +### Policy iteration The `DiscreteDP` policy iteration method runs as follows @@ -989,7 +989,7 @@ iterations. It returns an optimal value function and an optimal policy function (unless `iter_max` is reached). -### Modified Policy Iteration +### Modified policy iteration The `DiscreteDP` modified policy iteration method runs as follows: diff --git a/lectures/dyn_stack.md b/lectures/dyn_stack.md index 7c73017b..40aa128b 100644 --- a/lectures/dyn_stack.md +++ b/lectures/dyn_stack.md @@ -99,7 +99,7 @@ $$ where $\beta \in (0,1)$ is a time discount factor. -### Stackelberg Leader and Follower +### Stackelberg leader and follower Each firm $i=1,2$ chooses a sequence $\vec q_i \equiv \{q_{it+1}\}_{t=0}^\infty$ once and for all at @@ -119,7 +119,7 @@ In choosing $\vec q_2$, firm 2 takes into account that firm 1 will base its choice of $\vec q_1$ on firm 2's choice of $\vec q_2$. -### Statement of Leader's and Follower's Problems +### Statement of leader's and follower's problems We can express firm 1's problem as @@ -164,7 +164,7 @@ follower's best response to it. To gain insights about these things, we study them in more detail. -### Firms' Problems +### Firms' problems Firm 1 acts as if firm 2's sequence $\{q_{2t+1}\}_{t=0}^\infty$ is given and beyond its control. @@ -314,7 +314,7 @@ recursively. We'll proceed by putting our duopoly model into a broader class of models with the same general structure. -## Stackelberg Problem +## Stackelberg problem We formulate a class of linear-quadratic Stackelberg leader-follower problems of which our duopoly model is an instance. @@ -395,7 +395,7 @@ or y_{t+1} = A y_t + B u_t ``` -### Interpretation of Second Block of Equations +### Interpretation of second block of equations The Stackelberg follower's best response mapping is summarized by the second block of equations of {eq}`new3`. @@ -424,7 +424,7 @@ The Stackelberg leader uses its understanding of the responses restricted by {eq}`constrainteq` to manipulate the follower's decisions. -### More Mechanical Details +### More mechanical details For any vector $a_t$, define $\vec a_t = [a_t, a_{t+1} \ldots ]$. @@ -445,7 +445,7 @@ Although it is taken as given in $\Omega(y_0)$, eventually, the $x_0$ component of $y_0$ is to be chosen by the Stackelberg leader. -### Two Subproblems +### Two subproblems Once again we use backward induction. @@ -487,7 +487,7 @@ Subproblem 2 optimizes over $x_0$. The value function $w(z_0)$ tells the value of the Stackelberg plan as a function of the vector of natural state variables $z_0$ at time $0$. -## Two Bellman Equations +## Two Bellman equations We now describe Bellman equations for $v(y)$ and $w(z_0)$. @@ -550,7 +550,7 @@ $$ x_0 = - P_{22}^{-1} P_{21} z_0 $$ (eq:subprob2x0) -## Stackelberg Plan for Duopoly +## Stackelberg plan for duopoly Now let's map our duopoly model into the above setup. @@ -593,7 +593,7 @@ But firm 2 manipulates firm 1's choice through firm 2's choice of the sequence -### Calculations to Prepare Duopoly Model +### Calculations to prepare duopoly model Now we'll proceed to cast our duopoly model within the framework of the more general linear-quadratic structure described above. @@ -605,7 +605,7 @@ As emphasized above, firm 1 acts as if firm 2's decisions $\{q_{2t+1}, v_{2t}\}_{t=0}^\infty$ are given and beyond its control. -### Firm 1's Problem +### Firm 1's problem We again formulate firm 1's optimum problem in terms of the Lagrangian @@ -696,7 +696,7 @@ It is important to do this for several reasons: First, let's get a recursive representation of the Stackelberg leader's choice of $\vec q_2$ for our duopoly model. -## Recursive Representation of Stackelberg Plan +## Recursive representation of Stackelberg plan In order to attain an appropriate representation of the Stackelberg leader's history-dependent plan, we will employ what amounts to a @@ -781,7 +781,7 @@ $\sigma_t$ of a Stackelberg plan is **history-dependent**, meaning that the Stackelberg leader's choice $u_t$ depends not just on $\check z_t$ but on components of $\check z^{t-1}$. -### Comments and Interpretations +### Comments and interpretations Because we set $\check z_0 = z_0$, it will turn out that $z_t = \check z_t$ for all $t \geq 0$. @@ -795,7 +795,7 @@ sequence $\vec q_2$, we must use representation $\check z^t$ and **not** a corresponding representation cast in terms of $z^t$. -## Dynamic Programming and Time Consistency of Follower's Problem +## Dynamic programming and time consistency of follower's problem Given the sequence $\vec q_2$ chosen by the Stackelberg leader in our duopoly model, it turns out that the Stackelberg **follower's** @@ -808,7 +808,7 @@ To verify these claims, we'll formulate a recursive version of a follower's problem that builds on our recursive representation of the Stackelberg leader's plan and our use of the **Big K, little k** idea. -### Recursive Formulation of a Follower’s Problem +### Recursive formulation of a follower's problem We now use what amounts to another “Big $K$, little $k$” trick (see [rational expectations equilibrium](https://python-intro.quantecon.org/rational_expectations.html)) @@ -924,7 +924,7 @@ which will verify that we have properly set up a recursive representation of the follower's problem facing the Stackelberg leader's $\vec q_2$. -### Time Consistency of Follower's Plan +### Time consistency of follower's plan The follower can solve its problem using dynamic programming because its problem is recursive in what for it are the **natural state variables**, @@ -936,7 +936,7 @@ $$ It follows that the follower's plan is time consistent. -## Computing Stackelberg Plan +## Computing Stackelberg plan Here is our code to compute a Stackelberg plan via the linear-quadratic dynamic program describe above. @@ -1012,7 +1012,7 @@ print("Computed policy for Continuation Stackelberg leader\n") print(f"F = {F}") ``` -## Time Series for Price and Quantities +## Time series for price and quantities Now let's use the code to compute and display outcomes as a Stackelberg plan unfolds. @@ -1034,7 +1034,7 @@ ax.set_xlabel('t') plt.show() ``` -### Value of Stackelberg Leader +### Value of Stackelberg leader We'll compute the value $w(x_0)$ attained by the Stackelberg leader, where $x_0$ is given by the maximizer {eq}`eq:subprob2x0` of subproblem 2. @@ -1066,7 +1066,7 @@ v_expanded = -((y0.T @ R @ y0 + ut[:, 0].T @ Q @ ut[:, 0] + (v_leader_direct - v_expanded < tol0)[0, 0] ``` -## Time Inconsistency of Stackelberg Plan +## Time inconsistency of Stackelberg plan In the code below we compare two values @@ -1120,7 +1120,7 @@ The figure above shows Taken together, these outcomes express the time inconsistency of the original time $0$ Stackelberg leaders's plan. -## Recursive Formulation of Follower's Problem +## Recursive formulation of follower's problem We now formulate and compute the recursive version of the follower's problem. @@ -1172,7 +1172,7 @@ np.max(np.abs(yt_tilde[4] - yt_tilde[2])) yt[:, 0][-1] - (yt_tilde[:, 1] - yt_tilde[:, 0])[-1] < tol0 ``` -### Explanation of Alignment +### Explanation of alignment If we inspect coefficients in the decision rule $- \tilde F$, we should be able to spot why the follower chooses to set $x_t = @@ -1284,7 +1284,7 @@ plt.show() np.max(np.abs(yt_tilde_star[:, 4] - yt_tilde[2, :-1])) ``` -## Markov Perfect Equilibrium +## Markov perfect equilibrium The **state** vector is @@ -1403,7 +1403,7 @@ v2_direct_alt = - z[:, 0].T @ lq1.P @ z[:, 0] + lq1.d (np.abs(v2_direct - v2_direct_alt) < tol2).all() ``` -## Comparing Markov Perfect Equilibrium and Stackelberg Outcome +## Comparing Markov perfect equilibrium and Stackelberg outcome It is enlightening to compare equilbrium values for firms 1 and 2 under two alternative settings: diff --git a/lectures/entropy.md b/lectures/entropy.md index 1b94c7e9..81c6f7d7 100644 --- a/lectures/entropy.md +++ b/lectures/entropy.md @@ -35,7 +35,7 @@ The concept of entropy plays an important role in robust control formulations de -## Information Theory +## Information theory In information theory {cite}`Shannon_1949`, entropy is a measure of the unpredictability of a random variable. @@ -70,7 +70,7 @@ Shannon typically used base $2$. -## A Measure of Unpredictability +## A measure of unpredictability @@ -139,7 +139,7 @@ For $n=3$, $\log_2(3) = 1.585$. -## Mathematical Properties of Entropy +## Mathematical properties of entropy For a discrete random variable with probability vector $p$, entropy $H(p)$ is a function that satisfies @@ -151,7 +151,7 @@ $ H(\frac{1}{n}, \ldots, \frac{1}{n} ) \leq H(\frac{1}{n+1} , \ldots, \frac{1}{n * Entropy is not affected by events zero probability. -## Conditional Entropy +## Conditional entropy Let $(X,Y)$ be a bivariate discrete random vector with outcomes $x_1, \ldots, x_n$ and $y_1, \ldots, y_m$, respectively, occurring with probability density $p(x_i, y_i)$. @@ -165,7 +165,7 @@ $$ (eq:Shannon2) Here $\frac{p(y_j)}{p(x_i,y_j)}$, the reciprocal of the conditional probability of $x_i$ given $y_j$, can be defined as the **conditional surprisal**. -## Independence as Maximum Conditional Entropy +## Independence as maximum conditional entropy Let $m=n$ and $[x_1, \ldots, x_n ] = [y_1, \ldots, y_n]$. @@ -209,7 +209,7 @@ The second law of thermodynamics states that the entropy of a closed physical sy -## Statistical Divergence +## Statistical divergence Let $X$ be a discrete state space $x_1, \ldots, x_n$ and let $p$ and $q$ be two discrete probability distributions on $X$. @@ -331,7 +331,7 @@ D(N_0|N_1) = \frac{1}{2} \left(\mathrm {trace} (\Sigma_1^{-1} \Sigma_0) - k \right). $$ (eq:Shannon5) -## Von Neumann Entropy +## Von Neumann entropy Let $P$ and $Q$ be two positive-definite symmetric matrices. @@ -353,7 +353,7 @@ $$ -## Backus-Chernov-Zin Entropy +## Backus-Chernov-Zin entropy After flipping signs, {cite}`Backus_Chernov_Zin` use Kullback-Leibler relative entropy as a measure of volatility of stochastic discount factors that they @@ -396,7 +396,7 @@ $$ which they propose as a complement to a Hansen-Jagannathan {cite}`Hansen_Jagannathan_1991` bound. -## Wiener-Kolmogorov Prediction Error Formula as Entropy +## Wiener-Kolmogorov prediction error formula as entropy Let $\{x_t\}_{t=-\infty}^\infty$ be a covariance stationary stochastic process with mean zero and spectral density $S_x(\omega)$. @@ -435,7 +435,7 @@ all univariate covariance stationary processes with variance $\sigma_x^2$, a pro This no-patterns-across-time outcome for a temporally dependent process resembles the no-pattern-across-states outcome for the static entropy maximizing coin or die in the classic information theoretic analysis described above. -## Multivariate Processes +## Multivariate processes Let $y_t$ be an $n \times 1$ covariance stationary stochastic process with mean $0$ with matrix covariogram $C_y(j) = E y_t y_{t-j}' $ and spectral density matrix @@ -466,7 +466,7 @@ Being a measure of the unpredictability of an $n \times 1$ vector covariance st the left side of {eq}`eq:Shannon22` is sometimes called entropy. -## Frequency Domain Robust Control +## Frequency domain robust control Chapter 8 of {cite}`hansen2008robustness` adapts work in the control theory literature to define a **frequency domain entropy** criterion for robust control as @@ -490,7 +490,7 @@ This explains the moniker **maximum entropy** robust control for decision rules $F$ designed to maximize criterion {eq}`eq:Shannon21`. -## Relative Entropy for a Continuous Random Variable +## Relative entropy for a continuous random variable Let $x$ be a continuous random variable with density $\phi(x)$, and let $g(x) $ be a nonnegative random variable satisfying $\int g(x) \phi(x) dx =1$. diff --git a/lectures/estspec.md b/lectures/estspec.md index 4ccc4681..a1125421 100644 --- a/lectures/estspec.md +++ b/lectures/estspec.md @@ -311,7 +311,7 @@ ax.set_xlabel("Position in sequence of weights") plt.show() ``` -### Estimation with Smoothing +### Estimation with smoothing ```{index} single: Spectra, Estimation; Smoothing ``` @@ -350,7 +350,7 @@ and the choice of appropriate smoothing will have to be made based on judgement/priors or some other theory. (estspec_pfas)= -### Pre-Filtering and Smoothing +### Pre-filtering and smoothing ```{index} single: Spectra, Estimation; Pre-Filtering ``` @@ -395,7 +395,7 @@ provided the maximum possible amount of information about the value $I(\omega)$. Another way to put this is that if $I$ is relatively constant, then we can use a large amount of smoothing without introducing too much bias. (ar_periodograms)= -### The AR(1) Setting +### The AR(1) setting ```{index} single: Spectra, Estimation; AR(1) Setting ``` diff --git a/lectures/five_preferences.md b/lectures/five_preferences.md index ee547e5e..46d0349c 100644 --- a/lectures/five_preferences.md +++ b/lectures/five_preferences.md @@ -453,7 +453,7 @@ $$ (tom10) where the last term is $\tilde \theta$ times the entropy of the worst-case probability distribution. -## Multiplier preferences +## Multiplier preferences A decision maker is said to have **multiplier preferences** when he ranks consumption plans $c$ according to @@ -502,7 +502,7 @@ $$ - \theta \log \left(\sum_{j=1}^I \exp(- \theta^{-1} u(c_j) ) \pi_j \right) . $$ (tom13) -## Risk-sensitive preferences +## Risk-sensitive preferences Substituting $\hat m_i$ into $\sum_{i=1}^I \pi_i \hat m_i [ u(c_i) + \theta \log \hat m_i ]$ gives the indirect utility function @@ -701,7 +701,7 @@ which becomes expected utility $\mu_u$ when $\theta^{-1} = 0$. The right side of equation {eq}`tom200` is a special case of **stochastic differential utility** preferences in which consumption plans are ranked not just by their expected utilities $\mu_u$ but also the variances $\sigma_u^2$ of their expected utilities. -## Ex post Bayesian preferences +## Ex post Bayesian preferences A decision maker is said to have **ex post Bayesian preferences** when he ranks consumption plans according to the expected utility function diff --git a/lectures/growth_in_dles.md b/lectures/growth_in_dles.md index a6cb9798..37984fe4 100644 --- a/lectures/growth_in_dles.md +++ b/lectures/growth_in_dles.md @@ -51,7 +51,7 @@ import matplotlib.pyplot as plt from quantecon import DLE ``` -## Common Structure +## Common structure Our example economies have the following features @@ -114,7 +114,7 @@ $$ and the scalar $\beta$. -## A Planning Problem +## A planning problem The first welfare theorem asserts that a competitive equilibrium allocation solves the following planning problem. @@ -191,7 +191,7 @@ $$ x_{t+1} = A^ox_t + Cw_{t+1} $$ -## Example Economies +## Example economies Each of the example economies shown here will share a number of components. In particular, for each we will consider preferences of the @@ -389,7 +389,7 @@ print(econ1.css, econ1.iss, econ1.kss) However, the near-unity endogenous eigenvalue means that these steady state values are of little relevance. -### Example 2: Altered Growth Condition +### Example 2: altered growth condition We generate our next economy by making two alterations to the parameters of Example 1. @@ -460,7 +460,7 @@ than 1. econ2.endo, econ2.exo ``` -### Example 3: A Jones-Manuelli (1990) Economy +### Example 3: a Jones-Manuelli (1990) economy For our third economy, we choose parameter values with the aim of generating *sustained* growth in consumption, investment and capital. @@ -539,7 +539,7 @@ The other unit eigenvalue results from setting $\lambda = -1$. To show the importance of both of these for generating growth, we consider the following experiments. -### Example 3.1: Varying Sensitivity +### Example 3.1: varying sensitivity Next we raise $\lambda$ to -0.7 @@ -566,7 +566,7 @@ eigenvalues is now less than 1. econ4.endo, econ4.exo ``` -### Example 3.2: More Impatience +### Example 3.2: more impatience Next let's lower $\beta$ to 0.94 diff --git a/lectures/hs_recursive_models.md b/lectures/hs_recursive_models.md index 1e2b542f..f1a28497 100644 --- a/lectures/hs_recursive_models.md +++ b/lectures/hs_recursive_models.md @@ -35,7 +35,7 @@ kernelspec: "Every partial equilibrium model can be reinterpreted as a general equilibrium model." --   Anonymous ``` -## A Suite of Models +## A suite of models This lecture presents a class of linear-quadratic-Gaussian models of general economic equilibrium designed by Lars Peter Hansen and Thomas J. Sargent {cite}`HS2013`. @@ -52,7 +52,7 @@ Subsequent lectures use the DLE class to implement various instances that have a 1. {doc}`Cattle cycles ` 1. {doc}`Shock Non Invertibility ` -### Overview of the Models +### Overview of the models In saying that "complete markets are all alike", Robert E. Lucas, Jr. was noting that all of them have @@ -122,7 +122,7 @@ In these structures, to forecast, households and firms use: - equilibrium pricing functions, and - knowledge of the Markov structure of the economy’s state vector. -### Theory and Econometrics +### Theory and econometrics For an application of the {cite}`HS2013` class of models, the outcome of theorizing is a stochastic process, i.e., a probability distribution over sequences of prices and quantities, indexed by parameters describing preferences, technologies, and information flows. @@ -141,7 +141,7 @@ The second use of an equilibrium stochastic process or likelihood function is to The **inverse problem** takes as an input a time series sample of observations on a subset of prices and quantities determined by the model and from them makes inferences about the parameters that define the model's preferences, technologies, and information flows. -### More Details +### More details A {cite}`HS2013` economy consists of **lists of matrices** that describe peoples’ household technologies, their preferences over consumption services, their production technologies, and their information sets. @@ -208,7 +208,7 @@ Then we'll describe - Econometric representation and estimation (section-3)= -### Stochastic Model of Information Flows and Outcomes +### Stochastic model of information flows and outcomes We'll use stochastic linear difference equations to describe information flows **and** equilibrium outcomes. @@ -243,7 +243,7 @@ $n$ by $N$ matrix. Evidently, the distribution of $x_{t+1}$ conditional on $x_t$ is ${\mathcal N}(Ax_t, CC')$. -### Information Sets +### Information sets Let $J_0$ be generated by $x_0$ and $J_t$ be generated by $x_0, w_1, \ldots , @@ -251,7 +251,7 @@ w_t$, which means that $J_t$ consists of the set of all measurable functions of $\{x_0, w_1,\ldots, w_t\}$. -### Prediction Theory +### Prediction theory The optimal forecast of $x_{t+1}$ given current information is @@ -319,7 +319,7 @@ $$ \end{aligned} $$ -### Orthogonal Decomposition +### Orthogonal decomposition To decompose these covariances into parts attributable to the individual components of $w_t$, we let $i_\tau$ be an @@ -346,7 +346,7 @@ $j$-step-ahead prediction errors into the parts attributable to each of the components $\tau = 1, \ldots, N$. -### Taste and Technology Shocks +### Taste and technology shocks $E(w_t \mid J_{t-1}) = 0$ and $E(w_t w_t^\prime \mid J_{t-1}) = I$ for $t=1,2, \ldots$ @@ -381,7 +381,7 @@ We can now briefly summarize other components of our economies, in particular - Household technologies - Household preferences -### Production Technology +### Production technology Where $c_t$ is a vector of consumption rates, $k_t$ is a vector of physical capital goods, $g_t$ is a vector intermediate productions goods, $d_t$ is a vector of technology shocks, the production technology is @@ -400,7 +400,7 @@ For technical reasons that facilitate computations, we make the following. **Assumption:** $[\Phi_c\ \Phi_g]$ is nonsingular. -### Household Technology +### Household technology Households confront a technology that allows them to devote consumption goods to construct a vector $h_t$ of household capital goods and a vector $s_t$ of utility generating house services @@ -445,7 +445,7 @@ $$ so we'll be looking for specifications of the matrices $\Phi_c, \Phi_g, \Phi_i, \Gamma, \Delta_k, \Theta_k$ that define them. -### Endowment Economy +### Endowment economy There is a single consumption good that cannot be stored over time. @@ -487,7 +487,7 @@ $$ We can use this specification to create a linear-quadratic version of Lucas’s (1978) asset pricing model. -### Single-Period Adjustment Costs +### Single-period adjustment costs There is a single consumption good, a single intermediate good, and a single investment good. @@ -794,7 +794,7 @@ $$ - A Planning Problem or Optimal Resource Allocation Problem - Competitive Equilibrium -### Optimal Resource Allocation +### Optimal resource allocation Imagine a planner who chooses sequences $\{c_t, i_t, g_t\}_{t=0}^\infty$ to maximize @@ -841,7 +841,7 @@ We shall compare and utilize two approaches to solving the planning problem - Lagrangian formulation - Dynamic programming -### Lagrangian Formulation +### Lagrangian formulation Form the Lagrangian @@ -954,7 +954,7 @@ the approach we'll use. Instead, we'll use dynamic programming to get recursive representations for both quantities and shadow prices. -### Dynamic Programming +### Dynamic programming Dynamic Programming always starts with the word **let**. @@ -1186,7 +1186,7 @@ where $p_t^0$ belongs to $L_0^2$. With these objects in our toolkit, we move on to state the problem of a **Representative Household in a competitive equilibrium**. -### Representative Household +### Representative household The representative household owns endowment process and initial stocks of $h$ and $k$ and chooses stochastic processes for $\{c_t,\, s_t,\, h_t,\, @@ -1217,7 +1217,7 @@ $$ We now describe the problems faced by two types of firms called type I and type II. -### Type I Firm +### Type I firm A type I firm rents capital and labor and endowments and produces $c_t, i_t$. @@ -1241,7 +1241,7 @@ $$ -\, \ell_t^2 + g_t \cdot g_t = 0 $$ -### Type II Firm +### Type II firm A firm of type II acquires capital via investment and then rents stocks of capital to the $c,i$-producing type I firm. @@ -1263,7 +1263,7 @@ $$ k_t = \Delta_k k_{t-1} + \Theta_k i_t $$ -### Competitive Equilibrium: Definition +### Competitive equilibrium: definition We can now state the following. @@ -1361,7 +1361,7 @@ $$ \,\beta^\tau\, (A^o)^\tau\, C C^\prime (A^{o \prime})^\tau \right) $$ -### Re-Opening Markets +### Re-opening markets We have assumed that all trading occurs once-and-for-all at time $t=0$. @@ -1505,7 +1505,7 @@ $$ where $E a_t a_t^\prime \equiv \Omega = G \Sigma G^\prime + R$. -### Factorization of Likelihood Function +### Factorization of likelihood function Sample of observations $\{y_s\}_{s=0}^T$ on a $(n_y \times 1)$ vector. @@ -1526,14 +1526,14 @@ $$ + a_t' \Omega_t^{-1} a_t \biggr\} $$ -### Covariance Generating Functions +### Covariance generating functions Autocovariance: $C_x(\tau) = E x_t x_{t-\tau}'$. Generating Function: $S_x(z) = \sum_{\tau = -\infty}^\infty C_x(\tau) z^\tau, z \in C$. -### Spectral Factorization Identity +### Spectral factorization identity Original state-space representation has too many shocks and implies: @@ -1571,7 +1571,7 @@ $$ **Key Property:** Invertibility -### Wold and Vector Autoregressive Representations +### Wold and vector autoregressive representations Let's start with some lag operator arithmetic. @@ -1605,9 +1605,9 @@ y_t = \sum_{j=1}^\infty G (A^o -KG)^{j-1} K y_{t-j} + a_t $$ (wold-and-vector-autoregressive-representations-1)= -## Dynamic Demand Curves and Canonical Household Technologies +## Dynamic demand curves and canonical household technologies -### Canonical Household Technologies +### Canonical household technologies $$ \begin{aligned} @@ -1646,7 +1646,7 @@ $(\Delta_h - \Theta_h \Pi^{-1} $L_0^2$. (canonical-household-technologies-3)= -### Dynamic Demand Functions +### Dynamic demand functions $$ \rho^0_t \equiv \Pi^{-1 \prime} \Bigl[p^0_t - \Theta _h^\prime E_t @@ -1692,7 +1692,7 @@ preference shock $\{b_t\}$, as mediated through the multiplier $\mu_0^w$ and wealth $W_0$; and (iii) past values of consumption, as mediated through the state variable $h_{t-1}$. -## Gorman Aggregation and Engel Curves +## Gorman aggregation and Engel curves We shall explore how the dynamic demand schedule for consumption goods opens up the possibility of satisfying Gorman’s (1953) conditions for @@ -1716,7 +1716,7 @@ property, there exists a unique community or aggregate preference ordering over aggregate consumption that is independent of the distribution of wealth. -### Re-Opened Markets +### Re-opened markets $$ \rho^t_{t} \equiv \Pi^{-1 \prime} \Bigl[p^t_{t} - \Theta _h^\prime E_t @@ -1754,7 +1754,7 @@ h_t &= \Delta_h h_{t-1} + \Theta_h c_t \end{aligned} $$ -### Dynamic Demand +### Dynamic demand Define a time $t$ continuation of a sequence $\{z_t\}_{t=0}^\infty$ as the sequence @@ -1776,7 +1776,7 @@ process, and the household’s continuation plan for $\{\ell_t\}$. The time $t$ continuation of the vector of prices $\{p_t^t\}$. -### Attaining a Canonical Household Technology +### Attaining a canonical household technology Apply the following version of a factorization identity: @@ -1796,7 +1796,7 @@ The factorization identity guarantees that the $[\hat \Lambda, \hat \Pi]$ representation satisfies both requirements for a canonical representation. -## Partial Equilibrium +## Partial equilibrium Now we'll provide quick overviews of examples of economies that fit within our framework @@ -1858,7 +1858,7 @@ $$ \end{aligned} $$ -## Equilibrium Investment Under Uncertainty +## Equilibrium investment under uncertainty A representative firm maximizes @@ -1889,7 +1889,7 @@ $\alpha_0, \alpha_1$ are positive parameters. Assume that $u_t, d_t$ are uncorrelated first-order autoregressive processes. -## A Rosen-Topel Housing Model +## A Rosen-Topel housing model $$ \begin{aligned} @@ -1932,7 +1932,7 @@ where the price of new houses $p_t$ is related to $\rho_t^0$ by $\rho_t^0 = \pi^{-1} [ p_t - \beta \delta_h E_t p_{t+1}]$. -## Cattle Cycles +## Cattle cycles Rosen, Murphy, and Scheinkman (1994). Let $p_t$ be the price of freshly slaughtered beef, $m_t$ the feeding cost of preparing an @@ -1995,14 +1995,14 @@ zero representing a demand shifter. For more details see {doc}`Cattle cycles ` -## Models of Occupational Choice and Pay +## Models of occupational choice and pay We'll describe the following pair of schooling models that view education as a time-to-build process: - Rosen schooling model for engineers - Two-occupation model -### Market for Engineers +### Market for engineers Ryoo and Rosen’s (2004) {cite}`ryoo2004engineering` model consists of the following equations: @@ -2071,7 +2071,7 @@ $\lambda_1$ embodies Rosen’s demand parameter $\alpha_d$. For more details and Python code see {doc}`Rosen schooling model `. -### Skilled and Unskilled Workers +### Skilled and unskilled workers First, a demand curve for labor @@ -2127,7 +2127,7 @@ $$ v_{ut} = v_{st} $$ -## Permanent Income Models +## Permanent income models We'll describe a class of permanent income models that feature @@ -2197,7 +2197,7 @@ We have two types of implications of permanent income models: These have been tested in work by Hansen, Sargent, and Roberts (1991) {cite}`sargent1991observable` and by Attanasio and Pavoni (2011) {cite}`attanasio2011risk`. -## Gorman Heterogeneous Households +## Gorman heterogeneous households We now assume that there is a finite number of households, each with its own household technology and preferences over consumption services. @@ -2289,7 +2289,7 @@ $$ Here $h_{j,-1}$ given. -## Non-Gorman Heterogeneous Households +## Non-Gorman heterogeneous households We now describe a less tractable type of heterogeneity across households that we dub **Non-Gorman heterogeneity**. diff --git a/lectures/irfs_in_hall_model.md b/lectures/irfs_in_hall_model.md index 53fcf046..8b4cd1fa 100644 --- a/lectures/irfs_in_hall_model.md +++ b/lectures/irfs_in_hall_model.md @@ -155,7 +155,7 @@ unit eigenvalue in this economy. Investment is much more responsive to the endowment shock at shorter time horizons. -## Example 2: Higher Adjustment Costs +## Example 2: higher adjustment costs We generate our next economy by making only one change to the parameters of Example 1: we raise the parameter associated with the cost of @@ -214,7 +214,7 @@ The impulse response functions now show that an endowment shock does not have a permanent effect on the levels of either consumption or investment. -## Example 3: Durable Consumption Goods +## Example 3: durable consumption goods We generate our third economy by raising $\phi_1$ further, to 1.0. We also raise the production function parameter from 0.1 to 0.15 (which diff --git a/lectures/knowing_forecasts_of_others.md b/lectures/knowing_forecasts_of_others.md index d1bc0430..da6d1909 100644 --- a/lectures/knowing_forecasts_of_others.md +++ b/lectures/knowing_forecasts_of_others.md @@ -92,7 +92,7 @@ Rather than directly deploying the {cite}`PCL` machinery here, we shall instead * Therefore, equilibrium prices and quantities in Townsend's original model equal those in a pooling equilibrium. -### A Sequence of Models +### A sequence of models We proceed by describing a sequence of models of two industries that are linked in a single way: @@ -118,7 +118,7 @@ Technically, this lecture deploys concepts and tools that appear in [First Look at Kalman Filter](https://python-intro.quantecon.org/kalman.html) and [Rational Expectations Equilibrium](https://python-intro.quantecon.org/rational_expectations.html). -## The Setting +## The setting We cast all variables in terms of deviations from means. @@ -290,7 +290,7 @@ received by firms in industry $-i$. We shall verify this assertion by using a guess and verify tactic that involves running a least squares regression and inspecting its $R^2$. [^footnote0] -## Equilibrium Conditions +## Equilibrium conditions It is convenient to solve a firm’s problem without uncertainty by forming the Lagrangian: @@ -687,7 +687,7 @@ k_{t+1}^i & = \tilde \lambda k_t^i + {1 \over \lambda - \rho} \hat \theta_{t+ \theta_{t+1} & = \rho \theta_t + v_t . \end{aligned} ``` -### Two Noisy Signals +### Two noisy signals We now construct a **pooling equilibrium** by assuming that at time $t$ a firm in industry $i$ receives a vector $w_t$ of *two* noisy signals @@ -774,7 +774,7 @@ k_{t+1}^i & = \tilde \lambda k_t^i + {1 \over \lambda - \rho}\hat \theta_{t+1} Below, by using a guess-and-verify tactic, we shall show that outcomes in this **pooling equilibrium** equal those in an equilibrium under the alternative information structure that interested Townsend {cite}`townsend` but that originally seemed too challenging to compute. [^footnote5] -## Guess-and-Verify Tactic +## Guess-and-verify tactic As a preliminary step we shall take our recursive representation {eq}`sol0a` of an equilibrium in industry $i$ with one noisy signal @@ -798,9 +798,9 @@ structure. We proceed to analyze first the one-noisy-signal structure and then the two-noisy-signal structure. -## Equilibrium with One Noisy Signal on $\theta_t$ +## Equilibrium with one noisy signal on $\theta_t$ -### Step 1: Solve for $\tilde{\lambda}$ and $\lambda$ +### Step 1: solve for $\tilde{\lambda}$ and $\lambda$ 1. Cast $\left(\lambda-1\right)\left(\lambda-\frac{1}{\beta}\right)=b\lambda$ @@ -812,7 +812,7 @@ We proceed to analyze first the one-noisy-signal structure and then the two-nois Note that $p\left(\lambda\right)=\lambda^{2}-\left(1+b+\frac{1}{\beta}\right)\lambda+\frac{1}{\beta}$. -### Step 2: Solve for $p$ +### Step 2: solve for $p$ 1. Cast $p=\sigma_{v}^{2}+\frac{p\rho^{2}\sigma_{e}^{2}}{2p+\sigma_{e}^{2}}$ @@ -838,7 +838,7 @@ $$ \end{aligned} $$ -### Step 3: Represent the system using `quantecon.LinearStateSpace` +### Step 3: represent the system using `quantecon.LinearStateSpace` We use the following representation for constructing the `quantecon.LinearStateSpace` instance. @@ -1004,7 +1004,7 @@ x, y = lss.simulate(ts_length, random_state=1) np.max(np.abs(np.array([[1., b, 0., 0., 1., 0.]]) @ x - x[3])) < 1e-12 ``` -### Step 4: Compute impulse response functions +### Step 4: compute impulse response functions To compute impulse response functions of $k_t^i$, we use the `impulse_response` method of the `quantecon.LinearStateSpace` class and plot outcomes. @@ -1025,7 +1025,7 @@ Image(fig1.to_image(format="png")) # notebook locally ``` -### Step 5: Compute stationary covariance matrices and population regressions +### Step 5: compute stationary covariance matrices and population regressions We compute stationary covariance matrices by calling the `stationary_distributions` method of @@ -1094,7 +1094,7 @@ reg_res = model.fit() np.abs(reg_res.rsquared - 1.) < 1e-6 ``` -## Equilibrium with Two Noisy Signals on $\theta_t$ +## Equilibrium with two noisy signals on $\theta_t$ Steps 1, 4, and 5 are identical to those for the one-noisy-signal structure. @@ -1330,7 +1330,7 @@ R_squared = reg_coeffs @ Σ_x[2:6, 2:6] @ reg_coeffs / Σ_x[1, 1] R_squared ``` -## Key Step +## Key step Now we come to the key step for verifying that equilibrium outcomes for prices and quantities are identical in the pooling equilibrium original model that led Townsend to deduce an infinite-dimensional state space. @@ -1457,7 +1457,7 @@ Image(fig3.to_image(format="png")) # notebook locally ``` -## Comparison of All Signal Structures +## Comparison of all signal structures It is enlightening side by side to plot impulse response functions for capital for the two noisy-signal information structures and the noiseless signal on $\theta$ that we have just presented. @@ -1529,7 +1529,7 @@ $\epsilon_t^i$ in industry $i$ generates a response in $k_t^{-i}$ in the two-noi -## Notes on History of the Problem +## Notes on history of the problem To truncate what he saw as an intractable, infinite dimensional state space, Townsend constructed an approximating model in which the common hidden Markov demand shock diff --git a/lectures/lqramsey.md b/lectures/lqramsey.md index f370ccc6..fa6ee355 100644 --- a/lectures/lqramsey.md +++ b/lectures/lqramsey.md @@ -85,14 +85,14 @@ from collections import namedtuple from quantecon import nullspace, mc_sample_path, var_quadratic_sum ``` -### Model Features +### Model features * Linear quadratic (LQ) model * Representative household * Stochastic dynamic programming over an infinite horizon * Distortionary taxation -## The Ramsey Problem +## The Ramsey problem We begin by outlining the key assumptions regarding technology, households and the government sector. @@ -165,7 +165,7 @@ Given government tax and borrowing plans, we can construct a competitive equilib Among all such competitive equilibria, the Ramsey plan is the one that maximizes the welfare of the representative consumer. -### Exogenous Variables +### Exogenous variables Endowments, government expenditure, the preference shock process $b_t$, and promised coupon payments on initial government debt $s_t$ are all exogenous, and given by @@ -196,7 +196,7 @@ c_t + g_t = d_t + \ell_t A labor-consumption process $\{\ell_t, c_t\}$ is called *feasible* if {eq}`lq_feasible` holds for all $t$. -### Government Budget Constraint +### Government budget constraint Where $p_t^0$ is again a scaled Arrow-Debreu price, the time zero government budget constraint is @@ -347,7 +347,7 @@ Although it might not be clear yet, we are nearly there because: * Once we have the allocations, prices and the tax system can be derived from {eq}`lq_hfoc`. -### Computing the Quadratic Term +### Computing the quadratic term Let's consider how to obtain the term $\nu$ in {eq}`lq_gc22`. @@ -413,7 +413,7 @@ In this case, the formula for computing $q(x_0)$ is known to be $q(x_0) = x_0' Q The first equation is known as a discrete Lyapunov equation and can be solved using [this function](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/_matrix_eqn.py). -### Finite State Markov Case +### Finite state Markov case Next, suppose that $\{x_t\}$ is the discrete Markov process described {ref}`above `. @@ -448,7 +448,7 @@ the vector $(I - \beta P)^{-1} h$. This last fact is applied in the calculations below. -### Other Variables +### Other variables We are interested in tracking several other variables besides the ones described above. @@ -516,7 +516,7 @@ R^{-1}_{t} := \mathbb E_t \beta^j p^t_{t+1} $R_{t}$ is the gross $1$-period risk-free rate for loans between $t$ and $t+1$. -### A Martingale +### A martingale We now want to study the following two objects, namely, @@ -845,7 +845,7 @@ def gen_fig_2(path): plt.show() ``` -### Comments on the Code +### Comments on the code The function `var_quadratic_sum` imported from `quadsums` is for computing the value of {eq}`lq_eqs` when the exogenous process $\{ x_t \}$ is of the VAR type described {ref}`above `. @@ -871,7 +871,7 @@ Other than that, our code is long but relatively straightforward. Let's look at two examples of usage. (lq_cc)= -### The Continuous Case +### The continuous case Our first example adopts the VAR specification described {ref}`above `. @@ -928,7 +928,7 @@ See the original See the original [manuscript](https://lectures.quantecon.org/_downloads/firenze.pdf) for comments and interpretation. ``` -### The Discrete Case +### The discrete case Our second example adopts a discrete Markov specification for the exogenous process diff --git a/lectures/lu_tricks.md b/lectures/lu_tricks.md index 76605465..602ba388 100644 --- a/lectures/lu_tricks.md +++ b/lectures/lu_tricks.md @@ -61,7 +61,7 @@ import matplotlib.pyplot as plt Useful references include {cite}`Whittle1963`, {cite}`HanSar1980`, {cite}`Orfanidisoptimum1988`, {cite}`Athanasios1991`, and {cite}`Muth1960`. -## A Control Problem +## A control problem Let $L$ be the **lag operator**, so that, for sequence $\{x_t\}$ we have $L x_t = x_{t-1}$. @@ -130,7 +130,7 @@ You will be able to confirm that the objective function can be rewritten as {eq} Further examples of this problem for factor demand, economic growth, and government policy problems are given in ch. IX of {cite}`Sargent1987`. -## Finite Horizon Theory +## Finite horizon theory We first study a finite $N$ version of the problem. @@ -251,11 +251,11 @@ by concavity of the objective function. Next, we describe how to obtain the solution using matrix methods. (fdlq)= -### Matrix Methods +### Matrix methods Let's look at how linear algebra can be used to tackle and shed light on the finite horizon LQ control problem. -#### A Single Lag Term +#### A single lag term Let's begin with the special case in which $m=1$. @@ -347,7 +347,7 @@ which represents each element $y_t$ of $\bar y$ as a function of the entire vect That is, $y_t$ is a function of past, present, and future values of $a$'s, as well as of the initial condition $y_{-1}$. -#### An Alternative Representation +#### An alternative representation An alternative way to express the solution to {eq}`onefourfive` or {eq}`onefoursix` is in so-called **feedback-feedforward** form. @@ -431,7 +431,7 @@ where $L^{-1}_{ij}$ is the $(i,j)$ element of $L^{-1}$ and $U_{ij}$ is the $(i,j Note how the left side for a given $t$ involves $y_t$ and one lagged value $y_{t-1}$ while the right side involves all future values of the forcing process $a_t, a_{t+1}, \ldots, a_N$. -#### Additional Lag Terms +#### Additional lag terms We briefly indicate how this approach extends to the problem with $m > 1$. @@ -544,7 +544,7 @@ For now, we note that by creating the matrix $W$ for large $N$ and factoring it into the $LU$ form, good approximations to $c(L)$ and $c(\beta L^{-1})^{-1}$ can be obtained. -## Infinite Horizon Limit +## Infinite horizon limit For the infinite horizon problem, we propose to discover first-order necessary conditions by taking the limits of {eq}`onefour` and {eq}`onefive` as @@ -767,7 +767,7 @@ $hy^2_t$ and $[d(L)y_t]^2$, and so yields a finite value of Therefore it is easy to dominate a path that violates {eq}`onesix`. -## Undiscounted Problems +## Undiscounted problems It is worthwhile focusing on a special case of the LQ problems above: the undiscounted problem that emerges when $\beta = 1$. @@ -803,7 +803,7 @@ $$ \sum^\infty_{k=0} \lambda^k_j a_{t+k} $$ -### Transforming Discounted to Undiscounted Problem +### Transforming discounted to undiscounted problem Discounted problems can always be converted into undiscounted problems via a simple transformation. diff --git a/lectures/lucas_asset_pricing_dles.md b/lectures/lucas_asset_pricing_dles.md index ecef68b4..355c535d 100644 --- a/lectures/lucas_asset_pricing_dles.md +++ b/lectures/lucas_asset_pricing_dles.md @@ -132,7 +132,7 @@ x_0 = \right]' $$ -## Asset Pricing Equations +## Asset pricing equations {cite}`HS2013` show that the time t value of a permanent claim to a stream $y_s = U_ax_s \, , s \geq t$ is: @@ -160,7 +160,7 @@ $$ The use of $\bar e _1$ indicates that the first consumption good is the numeraire. -## Asset Pricing Simulations +## Asset pricing simulations ```{code-cell} python3 gam = 0 diff --git a/lectures/lucas_model.md b/lectures/lucas_model.md index e255d312..8c435918 100644 --- a/lectures/lucas_model.md +++ b/lectures/lucas_model.md @@ -48,7 +48,7 @@ from scipy.stats import lognorm import matplotlib.pyplot as plt ``` -## The Lucas Model +## The Lucas model ```{index} single: Lucas Model ``` @@ -64,7 +64,7 @@ Either way, the assumption of a representative agent means that prices adjust to This makes it very easy to compute competitive equilibrium prices. -### Basic Setup +### Basic setup Let's review the setup. @@ -112,7 +112,7 @@ Here * $u$ is a strictly increasing, strictly concave, continuously differentiable period utility function. * $\mathbb{E}$ is a mathematical expectation. -### Pricing a Lucas Tree +### Pricing a Lucas tree ```{index} single: Lucas Model; Pricing ``` @@ -145,7 +145,7 @@ The decision to hold share $\pi_t$ is actually made at time $t-1$. But this value is inherited as a state variable at time $t$, which explains the choice of subscript. -#### The Dynamic Program +#### The dynamic program ```{index} single: Lucas Model; Dynamic Program ``` @@ -197,7 +197,7 @@ The solution to this dynamic programming problem is an optimal policy expressing * Each one determines the other, since $c(\pi, y) = \pi (y + p(y))- \pi' (\pi, y) p(y)$ -#### Next Steps +#### Next steps What we need to do now is determine equilibrium prices. @@ -209,7 +209,7 @@ It seems that to obtain these, we will have to However, as Lucas showed, there is a related but more straightforward way to do this. -#### Equilibrium Constraints +#### Equilibrium constraints ```{index} single: Lucas Model; Equilibrium Constraints ``` @@ -223,7 +223,7 @@ In particular, the representative consumer owns the whole tree in every period, Prices must adjust to satisfy these two constraints. -#### The Equilibrium Price Function +#### The equilibrium price function ```{index} single: Lucas Model; Equilibrium Price Function ``` @@ -264,7 +264,7 @@ This is the famous consumption-based asset pricing equation. Before discussing it further we want to solve out for prices. -### Solving the Model +### Solving the model ```{index} single: Lucas Model; Solving ``` @@ -275,7 +275,7 @@ The solution is an equilibrium price function $p^*$. Let's look at how to obtain it. -#### Setting up the Problem +#### Setting up the problem Instead of solving for it directly we'll follow Lucas' indirect approach, first setting @@ -319,7 +319,7 @@ In other words, a solution is a *fixed point* of $T$. This means that we can use fixed point theory to obtain and compute the solution. -#### A Little Fixed Point Theory +#### A little fixed point theory ```{index} single: Fixed Point Theory ``` @@ -373,7 +373,7 @@ Since the right-hand side is an upper bound, taking the sup over all $y$ on the left-hand side gives {eq}`ltbc` with $\alpha := \beta$. (lt_comp_eg)= -### Computation -- An Example +### Computation -- an example ```{index} single: Lucas Model; Computation ``` diff --git a/lectures/match_transport.md b/lectures/match_transport.md index f1abce03..78115c46 100644 --- a/lectures/match_transport.md +++ b/lectures/match_transport.md @@ -15,7 +15,7 @@ kernelspec: +++ -## Overview +## Overview Optimal transport theory studies how a marginal probabilty measure can be related to another marginal probability measure in an ideal way. @@ -184,7 +184,7 @@ N_agents_per_side = 60 np.random.seed(1) -## Genetate random types +## Generate random types # generate random support for distributions of types support_size = 50 random_support = np.unique(np.random.uniform(0,200, size=support_size)) @@ -1614,7 +1614,7 @@ example_2.plot_matching(matching_NAM, title = 'NAM', +++ {"user_expressions": []} -### Example 3 +### Example 3 +++ {"user_expressions": []} @@ -1659,7 +1659,7 @@ example_3.plot_matching(matching_NAM, title = 'NAM', +++ {"user_expressions": []} -## Dual Solution +## Dual solution +++ {"user_expressions": []} @@ -1835,7 +1835,7 @@ The algorithm to compute the dual variables has a hierarchical structure: it sta We can visualize the hierarchical structure by computing the order in which he pairs will be processed and plotting the matching with color of the arcs corresponding the hierarchy. ```{code-cell} ipython3 -## Compute Hierarchies +## Compute hierarchies def find_hierarchies(subpairs): @@ -1868,7 +1868,7 @@ def find_hierarchies(subpairs): return hierarchies -## Plot Hierarchies +## Plot hierarchies def plot_hierarchies(self, subpairs, scatter=True, range_x_axis=None): # Compute hierarchies diff --git a/lectures/matsuyama.md b/lectures/matsuyama.md index 68dc7bb8..7ab13ffd 100644 --- a/lectures/matsuyama.md +++ b/lectures/matsuyama.md @@ -57,11 +57,11 @@ As we will see, coupled oscillators arise endogenously within the model. Below we review the model and replicate some of the results on synchronization of innovation across countries. -## Key Ideas +## Key ideas It is helpful to begin with an overview of the mechanism. -### Innovation Cycles +### Innovation cycles As discussed above, two countries produce and trade with each other. @@ -218,7 +218,7 @@ $$ The symbols $N_{j, t}^c$ and $N_{j, t}^m$ will denote the measures of $\Omega^c$ and $\Omega^m$ respectively. -### New Varieties +### New varieties To introduce a new variety, a firm must hire $f$ units of labor per variety in each country. @@ -244,7 +244,7 @@ N_{j,t}^m = \theta(M_{j,t} - N_{j,t}^c) \geq 0, \leq f $$ -### Law of Motion +### Law of motion With $\delta$ as the exogenous probability of a variety becoming obsolete, the dynamic equation for the measure of firms becomes @@ -643,7 +643,7 @@ class MSGSync: return ab ``` -### Time Series of Firm Measures +### Time series of firm measures We write a short function below that exploits the preceding code and plots two time series. @@ -691,7 +691,7 @@ In the first case, innovation in the two countries does not synchronize. In the second case, different initial conditions are chosen, and the cycles become synchronized. -### Basin of Attraction +### Basin of attraction Next, let's study the initial conditions that lead to synchronized cycles more systematically. diff --git a/lectures/muth_kalman.md b/lectures/muth_kalman.md index e43e4ddf..48934e49 100644 --- a/lectures/muth_kalman.md +++ b/lectures/muth_kalman.md @@ -95,7 +95,7 @@ The lecture [First Look at Kalman Filter](https://python-intro.quantecon.org/kal We'll use limiting versions of the Kalman filter corresponding to what are called **stationary values** in that lecture. -## A Process for Which Adaptive Expectations are Optimal +## A process for which adaptive expectations are optimal Suppose that an observable $y_t$ is the sum of an unobserved random walk $x_t$ and an IID shock $\epsilon_{2,t}$: @@ -184,7 +184,7 @@ Ak, Ck, Gk, Hk = A, K1, G, 1 ssk = LinearStateSpace(Ak, Ck, Gk, Hk, mu_0=x_hat_0) ``` -## Some Useful State-Space Math +## Some useful state-space math Now we want to map the time-invariant innovations representation {eq}`innovations` and the original state-space system {eq}`state-space` into a convenient form for deducing @@ -266,7 +266,7 @@ $\hat{x_t}$, and $y_t$. We can now investigate how these variables are related by plotting some key objects. -## Estimates of Unobservables +## Estimates of unobservables First, let’s plot the hidden state $x_t$ and the filtered version $\hat x_t$ that is linear-least squares projection of $x_t$ @@ -287,7 +287,7 @@ Note how $x_t$ and $\hat{x_t}$ differ. For Friedman, $\hat x_t$ and not $x_t$ is the consumer’s idea about her/his *permanent income*. -## Relationship of Unobservables to Observables +## Relationship of unobservables to observables Now let’s plot $x_t$ and $y_t$. @@ -320,7 +320,7 @@ ax.set_xlabel("Time") plt.show() ``` -## MA and AR Representations +## MA and AR representations Now we shall extract from the `Kalman` instance `kmuth` coefficients of diff --git a/lectures/opt_tax_recur.md b/lectures/opt_tax_recur.md index 6ca476d6..8c51f5f9 100644 --- a/lectures/opt_tax_recur.md +++ b/lectures/opt_tax_recur.md @@ -72,7 +72,7 @@ from numba import njit, prange, float64 from numba.experimental import jitclass ``` -## A Competitive Equilibrium with Distorting Taxes +## A competitive equilibrium with distorting taxes At time $t \geq 0$ a random variable $s_t$ belongs to a time-invariant set ${\cal S} = [1, 2, \ldots, S]$. @@ -181,7 +181,7 @@ They are indexed by different government policies. The **Ramsey problem** or **optimal taxation problem** is to choose a competitive equilibrium with distorting taxes that maximizes {eq}`TS_prefr_opt_tax`. -### Arrow-Debreu Version of Price System +### Arrow-Debreu version of price system We find it convenient sometimes to work with the Arrow-Debreu price system that is implied by a sequence of Arrow securities prices. @@ -203,7 +203,7 @@ Arrow-Debreu prices are useful when we want to compress a sequence of budget constraints into a single intertemporal budget constraint, as we shall find it convenient to do below. -### Primal Approach +### Primal approach We apply a popular approach to solving a Ramsey problem, called the *primal approach*. @@ -229,7 +229,7 @@ The primal approach uses four steps: 1. Use the Ramsey allocation together with the formulas from step 1 to find taxes and prices. -### The Implementability Constraint +### The implementability constraint By sequential substitution of one one-period budget constraint {eq}`TS_bcr` into another, we can obtain the household's present-value budget constraint: @@ -299,7 +299,7 @@ The **Ramsey problem** is to choose a feasible allocation that maximizes subject to {eq}`TSs_cham1`. -### Solution Details +### Solution details First, define a "pseudo utility function" @@ -435,7 +435,7 @@ The proposition asserts that the optimal allocation is a function of the currently realized quantity of government purchases $g$ only and does *not* depend on the specific history that preceded that realization of $g$. -### The Ramsey Allocation for a Given Multiplier +### The Ramsey allocation for a given multiplier Temporarily take $\Phi$ as given. @@ -465,7 +465,7 @@ the household and the government’s budget constraints are both satisfied at a candidate Ramsey allocation and price system associated with that $\Phi$. -### Further Specialization +### Further specialization At this point, it is useful to specialize the model in the following ways. @@ -481,7 +481,7 @@ $g(s)$ of $s$. We maintain these assumptions throughout the remainder of this lecture. -### Determining the Lagrange Multiplier +### Determining the Lagrange multiplier We complete the Ramsey plan by computing the Lagrange multiplier $\Phi$ on the implementability constraint {eq}`TSs_cham1`. @@ -613,7 +613,7 @@ $s_t$, a Ramsey plan can be constructed by solving $3S +3$ equations for $S$ components each of $\vec c$, $\vec n$, and $\vec x$ together with $n_0, c_0$, and $\Phi$. -### Time Inconsistency +### Time inconsistency Let $\{\tau_t(s^t)\}_{t=0}^\infty, \{b_{t+1}(s_{t+1}| s^t)\}_{t=0}^\infty$ be a time $0$, state $s_0$ Ramsey plan. @@ -638,7 +638,7 @@ $b_t(s_t|s^{t-1})$. We shall discuss this more below. -### Specification with CRRA Utility +### Specification with CRRA utility In our calculations below and in a {doc}`subsequent lecture ` based on an *extension* of the Lucas-Stokey model by Aiyagari, Marcet, Sargent, and Seppälä (2002) {cite}`aiyagari2002optimal`, we shall modify the one-period utility function assumed above. @@ -717,7 +717,7 @@ $$ \end{aligned} $$ -### Sequence Implementation +### Sequence implementation The above steps are implemented in a class called SequentialLS @@ -725,7 +725,7 @@ The above steps are implemented in a class called SequentialLS :load: _static/lecture_specific/opt_tax_recur/sequential_allocation.py ``` -## Recursive Formulation of the Ramsey Problem +## Recursive formulation of the Ramsey problem We now temporarily revert to Lucas and Stokey's specification. @@ -736,7 +736,7 @@ But $x_t(s^t)$ is a natural candidate for a state variable in a recursive formulation of the Ramsey problem, one that records history-dependence and so is `backward-looking`. -### Intertemporal Delegation +### Intertemporal delegation To express a Ramsey plan recursively, we imagine that a time $0$ Ramsey planner is followed by a sequence of continuation Ramsey planners @@ -779,7 +779,7 @@ responsibilities across time express the continuation Ramsey planners’ obligations to implement their parts of an original Ramsey plan that had been designed once-and-for-all at time $0$. -### Two Bellman Equations +### Two Bellman equations After $s_t$ has been realized at time $t \geq 1$, the state variables confronting the time $t$ **continuation Ramsey planner** are @@ -791,7 +791,7 @@ $(x_t, s_t)$. We work backward by preparing a Bellman equation for $V(x,s)$ first, then a Bellman equation for $W(b,s)$. -### The Continuation Ramsey Problem +### The continuation Ramsey problem The Bellman equation for a time $t \geq 1$ continuation Ramsey planner is @@ -830,7 +830,7 @@ are $S+1$ time-invariant policy functions \end{aligned} ``` -### The Ramsey Problem +### The Ramsey problem The Bellman equation of the time $0$ Ramsey planner is @@ -877,7 +877,7 @@ $E_t \sum_{\tau = t}^\infty \beta^{\tau - t} u(c_\tau, l_\tau)$, where consumption and leisure processes are evaluated along the original time $0$ Ramsey plan. -### First-Order Conditions +### First-order conditions Attach a Lagrange multiplier $\Phi_1(x,s)$ to constraint {eq}`LSA_Bellman1cons` and a Lagrange multiplier $\Phi_0$ to constraint {eq}`Bellman2cons`. @@ -954,7 +954,7 @@ Naturally, the first-order conditions in this recursive formulation of the Ramsey problem agree with the first-order conditions derived when we first formulated the Ramsey plan in the space of sequences. -### State Variable Degeneracy +### State variable degeneracy Equations {eq}`LSAenv` and {eq}`LSAx0` imply that $\Phi_0 = \Phi_1$ and that @@ -976,7 +976,7 @@ can be expressed as a vector $\vec x$ that solves equation {eq}`Bellman2cons2` for $n$ and $c$ as functions of $g$ that are associated with $\Phi = \Phi_0$. -### Manifestations of Time Inconsistency +### Manifestations of time inconsistency While the marginal utility adjusted level of government debt $x_t$ is a key state variable for the continuation Ramsey planners at @@ -1019,7 +1019,7 @@ time $0$ and time $t \geq 1$ objects reflect the Ramsey planner’s incentive to manipulate Arrow security prices and, through them, the value of initial government debt $b_0$. -### Recursive Implementation +### Recursive implementation The above steps are implemented in a class called `RecursiveLS`. @@ -1031,7 +1031,7 @@ The above steps are implemented in a class called `RecursiveLS`. We return to the setup with CRRA preferences described above. -### Anticipated One-Period War +### Anticipated one-period war This example illustrates in a simple setting how a Ramsey planner manages risk. @@ -1170,7 +1170,7 @@ ax.grid() plt.show() ``` -### Government Saving +### Government saving At time $t=0$ the government evidently *dissaves* since $b_1> b_0$. @@ -1197,7 +1197,7 @@ At times $t \geq 4$ the government rolls over its debt, knowing that the tax rate is set at a level that raises enough revenue to pay for government purchases and interest payments on its debt. -### Time 0 Manipulation of Interest Rate +### Time 0 manipulation of interest rate We have seen that when $b_0>0$, the Ramsey plan sets the time $t=0$ tax rate partly with an eye toward lowering a risk-free interest @@ -1209,7 +1209,7 @@ relative to consumption goods at later times. By doing this, it lowers the value of time $t=0$ debt that it has inherited and must finance. -### Time 0 and Time-Inconsistency +### Time 0 and time-inconsistency In the preceding example, the Ramsey tax rate at time 0 differs from its value at time 1. @@ -1316,7 +1316,7 @@ plt.show() The tax rates in the figure are equal for only two values of initial government debt. -### Tax Smoothing and non-CRRA Preferences +### Tax smoothing and non-CRRA preferences The complete tax smoothing for $t \geq 1$ in the preceding example is a consequence of our having assumed CRRA preferences. @@ -1399,7 +1399,7 @@ Unlike outcomes with CRRA preferences, the tax rate is not perfectly smoothed. Instead, the government raises the tax rate when $g_t$ is high. -### Further Comments +### Further comments A {doc}`related lecture ` describes an extension of the Lucas-Stokey model by Aiyagari, Marcet, Sargent, and Seppälä (2002) {cite}`aiyagari2002optimal`. diff --git a/lectures/permanent_income_dles.md b/lectures/permanent_income_dles.md index 285f71f2..c8253e66 100644 --- a/lectures/permanent_income_dles.md +++ b/lectures/permanent_income_dles.md @@ -57,7 +57,7 @@ from quantecon import DLE np.set_printoptions(suppress=True, precision=4) ``` -## The Permanent Income Model +## The permanent income model The LQ permanent income model is an example of a **savings problem**. @@ -151,7 +151,7 @@ $$ y_{t+1} = \alpha + \rho_1 y_t + \rho_2 y_{t-1} + \sigma w_{t+1} $$ -### Solution with the DLE Class +### Solution with the DLE class One way of solving this model is to map the problem into the framework outlined in Section 4.8 of {cite}`HS2013` by setting up our technology, diff --git a/lectures/rob_markov_perf.md b/lectures/rob_markov_perf.md index ff77cf2a..645e9a2c 100644 --- a/lectures/rob_markov_perf.md +++ b/lectures/rob_markov_perf.md @@ -56,7 +56,7 @@ from scipy.linalg import solve import matplotlib.pyplot as plt ``` -### Basic Setup +### Basic setup Decisions of two agents affect the motion of a state vector that appears as an argument of payoff functions of both agents. @@ -82,7 +82,7 @@ A Markov perfect equilibrium with robust agents will be characterized by Below, we'll construct a robust firms version of the classic duopoly model with adjustment costs analyzed in [Markov perfect equilibrium](https://python-intro.quantecon.org/markov_perf.html). -## Linear Markov Perfect Equilibria with Robust Agents +## Linear Markov perfect equilibria with robust agents ```{index} single: Linear Markov Perfect Equilibria ``` @@ -92,7 +92,7 @@ leads us to an interrelated pair of Bellman equations. In linear quadratic dynamic games, these "stacked Bellman equations" become "stacked Riccati equations" with a tractable mathematical structure. -### Modified Coupled Linear Regulator Problems +### Modified coupled linear regulator problems We consider a general linear quadratic regulator game with two players, each of whom fears model misspecifications. @@ -160,7 +160,7 @@ agent $i$'s mind charges for distorting the law of motion in a way that harms ag * the imaginary loss-maximizing agent helps the loss-minimizing agent by helping him construct bounds on the behavior of his decision rule over a large **set** of alternative models of state transition dynamics. -### Computing Equilibrium +### Computing equilibrium We formulate a linear robust Markov perfect equilibrium as follows. @@ -268,7 +268,7 @@ Moreover, since we need to solve these $k_1 + k_2$ equations simultaneously. -### Key Insight +### Key insight As in [Markov perfect equilibrium](https://python-intro.quantecon.org/markov_perf.html), a key insight here is that equations {eq}`rmp-orig-3` and {eq}`rmp-orig-5` are linear in $F_{1t}$ and $F_{2t}$. @@ -282,7 +282,7 @@ However, in the Markov perfect equilibrium of this game, each agent is assumed t After these equations have been solved, we can also deduce associated sequences of worst-case shocks. -### Worst-case Shocks +### Worst-case shocks For agent $i$ the maximizing or worst-case shock $v_{it}$ is @@ -296,7 +296,7 @@ $$ K_{it} = \theta_i^{-1} (I - \theta_i^{-1} C' P_{i,t+1} C)^{-1} C' P_{i,t+1} (A - B_1 F_{it} - B_2 F_{2t}) $$ -### Infinite Horizon +### Infinite horizon We often want to compute the solutions of such games for infinite horizons, in the hope that the decision rules $F_{it}$ settle down to be time-invariant as $t_1 \rightarrow +\infty$. @@ -315,7 +315,7 @@ game with robust planers in the manner described above. ```{index} single: Markov Perfect Equilibrium; Applications ``` -### A Duopoly Model +### A duopoly model Without concerns for robustness, the model is identical to the duopoly model from the [Markov perfect equilibrium](https://python-intro.quantecon.org/markov_perf.html) lecture. @@ -438,7 +438,7 @@ A robust decision rule of firm $i$ will take the form $u_{it} = - F_i x_t$, ind x_{t+1} = (A - B_1 F_1 -B_1 F_2 ) x_t ``` -### Parameters and Solution +### Parameters and solution Consider the duopoly model with parameter values of: @@ -453,7 +453,7 @@ From these, we computed the infinite horizon MPE without robustness using the co :load: _static/lecture_specific/markov_perf/duopoly_mpe.py ``` -#### Markov Perfect Equilibrium with Robustness +#### Markov perfect equilibrium with robustness We add robustness concerns to the Markov Perfect Equilibrium model by extending the function `qe.nnash` @@ -630,7 +630,7 @@ def nnash_robust(A, C, B1, B2, R1, R2, Q1, Q2, S1, S2, W1, W2, M1, M2, return F1, F2, P1, P2 ``` -### Some Details +### Some details Firm $i$ wants to minimize @@ -723,7 +723,7 @@ Q1 = Q2 = γ S1 = S2 = W1 = W2 = M1 = M2 = 0.0 ``` -#### Consistency Check +#### Consistency check We first conduct a comparison test to check if `nnash_robust` agrees with `qe.nnash` in the non-robustness case in which each $\theta_i \approx +\infty$ @@ -747,7 +747,7 @@ print('P2 and P2r should be the same: ', np.allclose(P1, P1r)) We can see that the results are consistent across the two functions. -#### Comparative Dynamics under Baseline Transition Dynamics +#### Comparative dynamics under baseline transition dynamics We want to compare the dynamics of price and output under the baseline MPE model with those under the baseline model under the robust decision rules within the robust MPE. @@ -912,7 +912,7 @@ To explore this, we study next how *ex-post* the two firms' beliefs about state (by *ex-post* we mean *after* extremization of each firm's intertemporal objective) -#### Heterogeneous Beliefs +#### Heterogeneous beliefs As before, let $A^o = A - B\_1 F\_1^r - B\_2 F\_2^r$, where in a robust MPE, $F_i^r$ is a robust decision rule for firm $i$. diff --git a/lectures/robustness.md b/lectures/robustness.md index 9b824f68..86ed120c 100644 --- a/lectures/robustness.md +++ b/lectures/robustness.md @@ -85,7 +85,7 @@ import quantecon as qe ``` (rb_vec)= -### Sets of Models Imply Sets Of Values +### Sets of models imply sets of values Our "robust" decision-maker wants to know how well a given rule will work when he does not *know* a single transition law $\ldots$. @@ -144,18 +144,18 @@ We will also describe how to choose $F$ to shape the sets of values. This will involve crafting a *skinnier* set at the cost of a lower *level* (at least for low values of entropy). -### Inspiring Video +### Inspiring video If you want to understand more about why one serious quantitative researcher is interested in this approach, we recommend [Lars Peter Hansen's Nobel lecture](https://www.nobelprize.org/prizes/economic-sciences/2013/hansen/lecture/). -### Other References +### Other references Our discussion in this lecture is based on * {cite}`HansenSargent2000` * {cite}`HansenSargent2008` -## The Model +## The model For simplicity, we present ideas in the context of a class of problems with linear transition laws and quadratic objective functions. @@ -210,7 +210,7 @@ A sequence $\{ w_t \}$ might represent Soon we'll quantify the quality of a model specification in terms of the maximal size of the discounted sum $\sum_{t=0}^{\infty} \beta^{t+1}w_{t+1}' w_{t+1}$. -## Constructing More Robust Policies +## Constructing more robust policies If our agent takes $\{ w_t \}$ as a given deterministic sequence, then, drawing on ideas in earlier lectures on dynamic programming, we can anticipate Bellman equations such as @@ -253,7 +253,7 @@ By raising $\theta$ more and more, we more and more limit the ability of maximiz So bigger $\theta$ is implicitly associated with smaller distortion sequences $\{w_t \}$. -### Analyzing the Bellman Equation +### Analyzing the Bellman equation So what does $J$ in {eq}`rb_wcb0` look like? @@ -353,7 +353,7 @@ Furthermore, when $\theta$ is large, $\hat K$ is approximately equal to zero. Conversely, smaller $\theta$ is associated with greater fear of model misspecification and greater concern for robustness. -## Robustness as Outcome of a Two-Person Zero-Sum Game +## Robustness as outcome of a two-person zero-sum game What we have done above can be interpreted in terms of a two-person zero-sum game in which $\hat F, \hat K$ are Nash equilibrium objects. @@ -366,7 +366,7 @@ Agent 2's malevolence helps the original agent to compute bounds on his value fu We begin with agent 2's problem. (rb_a2)= -### Agent 2's Problem +### Agent 2's problem Agent 2 @@ -464,9 +464,9 @@ The remaining step for agent 2's problem is to set $\theta$ to enforce the const Here $x_t$ is given by {eq}`rob_lomf` --- which in this case becomes $x_{t+1} = (A - B F + CK(F, \theta)) x_t$. (rb_a1)= -### Using Agent 2's Problem to Construct Bounds on Value Sets +### Using Agent 2's problem to construct bounds on value sets -#### The Lower Bound +#### The lower bound Define the minimized object on the right side of problem {eq}`rb_a2o` as $R_\theta(x_0, F)$. @@ -518,7 +518,7 @@ To construct the *lower bound* on the set of values associated with all perturba This procedure sweeps out a set of separating hyperplanes indexed by different values for the Lagrange multiplier $\theta$. ``` -#### The Upper Bound +#### The upper bound To construct an *upper bound* we use a very similar procedure. @@ -575,11 +575,11 @@ To construct the *upper bound* on the set of values associated all perturbations * Compute the upper bound on the value function $V_{\tilde \theta}(x_0, F) + \tilde \theta \ {\rm ent}$ and plot it against ${\rm ent}$. * Repeat the preceding three steps for a range of values of $\tilde \theta$ to trace out the upper bound. -#### Reshaping the Set of Values +#### Reshaping the set of values Now in the interest of *reshaping* these sets of values by choosing $F$, we turn to agent 1's problem. -### Agent 1's Problem +### Agent 1's problem Now we turn to agent 1, who solves @@ -618,7 +618,7 @@ Once again, the expression for the optimal policy can be found [here](https://py it by $\tilde F$. (rb_eq)= -### Nash Equilibrium +### Nash equilibrium Clearly, the $\tilde F$ we have obtained depends on $K$, which, in agent 2's problem, depended on an initial policy $F$. @@ -644,7 +644,7 @@ In particular, for any given $\theta$, A sketch of the proof is given in {ref}`the appendix `. -## The Stochastic Case +## The stochastic case Now we turn to the stochastic case, where the sequence $\{w_t\}$ is treated as an IID sequence of random vectors. @@ -687,7 +687,7 @@ The distribution $\phi$ is chosen as the least desirable conditional distributio This penalty term plays a role analogous to the one played by the deterministic penalty $\theta w'w$ in {eq}`rb_wcb0`, since it discourages large deviations from the benchmark. -### Solving the Model +### Solving the model The maximization problem in {eq}`rb_wcb1` appears highly nontrivial --- after all, we are maximizing over an infinite dimensional space consisting of the entire set of densities. @@ -777,11 +777,11 @@ where $\hat K$ is given by {eq}`rb_kd`. Note that the mean of the worst-case shock distribution is equal to the same worst-case $w_{t+1}$ as in the earlier deterministic setting. (rb_coq)= -### Computing Other Quantities +### Computing other quantities Before turning to implementation, we briefly outline how to compute several other quantities of interest. -#### Worst-Case Value of a Policy +#### Worst-case value of a policy One thing we will be interested in doing is holding a policy fixed and computing the discounted loss associated with that policy. diff --git a/lectures/rosen_schooling_model.md b/lectures/rosen_schooling_model.md index ec0e21bb..585744e1 100644 --- a/lectures/rosen_schooling_model.md +++ b/lectures/rosen_schooling_model.md @@ -44,7 +44,7 @@ from collections import namedtuple from quantecon import DLE ``` -## A One-Occupation Model +## A one-occupation model Ryoo and Rosen's (2004) {cite}`ryoo2004engineering` partial equilibrium model determines @@ -81,7 +81,7 @@ $$ n_t = \alpha_s v_t + \epsilon_{st} $$ -## Mapping into HS2013 Framework +## Mapping into HS2013 framework We represent this model in the {cite}`HS2013` framework by @@ -163,7 +163,7 @@ Technology = namedtuple('Technology', ['ϕ_c', 'ϕ_g', 'ϕ_i', 'γ', 'δ_k', 'θ Preferences = namedtuple('Preferences', ['β', 'l_λ', 'π_h', 'δ_h', 'θ_h']) ``` -### Effects of Changes in Education Technology and Demand +### Effects of changes in education technology and demand We now study how changing diff --git a/lectures/smoothing.md b/lectures/smoothing.md index c4b8dabd..e781f9e0 100644 --- a/lectures/smoothing.md +++ b/lectures/smoothing.md @@ -82,7 +82,7 @@ import matplotlib.pyplot as plt import scipy.linalg as la ``` -### Relationship to Other Lectures +### Relationship to other lectures This lecture can be viewed as a followup to [Optimal Savings II: LQ Techniques](https://python-intro.quantecon.org/perm_income_cons.html) @@ -115,7 +115,7 @@ These state-contingent securities are commonly called Arrow securities, after [K In the **incomplete markets version**, the consumer can buy and sell only one security each period, a risk-free one-period bond with gross one-period return $\beta^{-1}$. -## Linear State Space Version of Complete Markets Model +## Linear state space version of complete markets model We'll study a complete markets model adapted to a setting with a continuous Markov state like that in the [first lecture on the permanent income model](https://python-intro.quantecon.org/perm_income.html). @@ -344,7 +344,7 @@ ax[1].set_xlabel('Periods') plt.show() ``` -### Interpretation of Graph +### Interpretation of graph In the above graph, please note that: @@ -356,14 +356,14 @@ In the above graph, please note that: (meaning linear plus a constant) of the consumer's nonfinancial income. -### Incomplete Markets Version +### Incomplete markets version The incomplete markets version of the model with nonfinancial income being governed by a linear state space system is described in [permanent income model](https://python-intro.quantecon.org/perm_income_cons.html). In that incomplete markerts setting, consumption follows a random walk and the consumer's debt follows a process with a unit root. -### Finite State Markov Income Process +### Finite state Markov income process We now turn to a finite-state Markov version of the model in which the consumer's nonfinancial income is an exact function of a Markov state that takes one of $N$ values. @@ -408,7 +408,7 @@ u(c_t) = - (c_t -\gamma)^2 Here $\gamma >0$ is a bliss level of consumption -### Market Structure +### Market structure Our complete and incomplete markets models differ in how thoroughly the market structure allows a consumer to transfer resources across time and Markov states, there @@ -421,7 +421,7 @@ Watch how these differences in opportunities affect - how the consumer chooses to make his levels of indebtedness behave over time and across Markov states -## Model 1 (Complete Markets) +## Model 1 (complete markets) At each date $t \geq 0$, the consumer trades a full array of **one-period ahead Arrow securities**. @@ -593,7 +593,7 @@ an equation that we can solve for the unknown $b(2)$. Knowing $b(1)$ and $b(2)$, we can solve equation {eq}`cs_5` for the constant level of consumption $\bar c$. -### Key Outcomes +### Key outcomes The preceding calculations indicate that in the complete markets version of our model, we obtain the following striking results: @@ -756,7 +756,7 @@ Below, we'll take the outcomes produced by this code -- in particular the implie consumption and debt paths -- and compare them with outcomes from an incomplete markets model in the spirit of Hall {cite}`Hall1978` -## Model 2 (One-Period Risk-Free Debt Only) +## Model 2 (one-period risk-free debt only) This is a version of the original model of Hall (1978) in which the consumer's ability to substitute intertemporally is @@ -879,7 +879,7 @@ and the increment to debt is b_{t+1} - b_t = \beta^{-1} [ (1- \beta) v(i) - y(i) ] ``` -### Summary of Outcomes +### Summary of outcomes In contrast to outcomes in the complete markets model, in the incomplete markets model @@ -895,7 +895,7 @@ markets model current consumption on today's debt level account for the drift over time in consumption. -### The Incomplete Markets Model +### The incomplete markets model The code above also contains a function called `consumption_incomplete()` that uses {eq}`cs_12` and {eq}`cs_13` to diff --git a/lectures/smoothing_tax.md b/lectures/smoothing_tax.md index a637835b..9f8c37c0 100644 --- a/lectures/smoothing_tax.md +++ b/lectures/smoothing_tax.md @@ -63,7 +63,7 @@ incomplete markets version of our model. In addition, we extend their assumption about the interest rate to an appropriate counterpart to create a "complete markets" model in the style of Lucas and Stokey {cite}`LucasStokey1983`. -### Isomorphism between Consumption and Tax Smoothing +### Isomorphism between consumption and tax smoothing For each version of a consumption-smoothing model, a tax-smoothing counterpart can be obtained simply by relabeling @@ -82,7 +82,7 @@ For elaborations on this theme, please see [Optimal Savings II: LQ Techniques](h We'll spend most of this lecture studying acquire finite-state Markov specification, but will also treat the linear state space specification. -#### Link to History +#### Link to history For those who love history, President Thomas Jefferson's Secretary of Treasury Albert Gallatin (1807) {cite}`Gallatin` seems to have prescribed policies that come from Barro's model {cite}`Barro1979` @@ -300,7 +300,7 @@ ax[1].set_xlabel('Periods') plt.show() ``` -## Tax Smoothing with Complete Markets +## Tax smoothing with complete markets It is instructive to focus on a simple tax-smoothing example with complete markets. @@ -345,7 +345,7 @@ $$ in which the term $(\sum_j Q_{ij} b_j - b_i)$ equals the net amount that the government spends to purchase one-period Arrow securities that will pay off next period in Markov states $j = 1, \ldots, N$ after it has received payments $b_i$ this period. -## Returns on State-Contingent Debt +## Returns on state-contingent debt Notice that $\sum_{j'=1}^N Q_{ij'} b(j')$ is the amount that the government spends in Markov state $i$ at time $t$ to purchase one-period state-contingent claims that will pay off in Markov state $j'$ at time $t+1$. @@ -403,7 +403,7 @@ def cumulative_return(s_path, R): return RT_path ``` -### An Example of Tax Smoothing +### An example of tax smoothing We'll study a tax-smoothing model with two Markov states. @@ -534,7 +534,7 @@ war in debt and $b_2 = -10$. ```{exercise-end} ``` -## More Finite Markov Chain Tax-Smoothing Examples +## More finite Markov chain tax-smoothing examples To interpret some episodes in the fiscal history of the United States, we find it interesting to study a few more examples. @@ -866,7 +866,7 @@ ts_ex5 = TaxSmoothingExample(g_ex5, P_ex5, b0_ex5, states_ex5, N_simul=7, random ts_ex5.display() ``` -### Continuous-State Gaussian Model +### Continuous-state Gaussian model To construct a tax-smoothing version of the complete markets consumption-smoothing model with a continuous state space that we presented in the lecture {doc}`consumption smoothing with complete and incomplete markets `, we simply relabel variables. @@ -910,7 +910,7 @@ $$ R(x_{t+1} | x_t) = \frac{b(x_{t+1})}{\beta E b(x_{t+1})| x_t} $$ -#### Related Lectures +#### Related lectures Throughout this lecture, we have taken one-period interest rates and Arrow security prices as exogenous objects determined outside the model and specified them in ways designed to align our models closely with the consumption smoothing model of Barro {cite}`Barro1979`. diff --git a/lectures/stationary_densities.md b/lectures/stationary_densities.md index ab148ee8..20245f2c 100644 --- a/lectures/stationary_densities.md +++ b/lectures/stationary_densities.md @@ -80,7 +80,7 @@ from scipy.stats import norm, gaussian_kde ``` (statd_density_case)= -## The Density Case +## The density case You are probably aware that some distributions can be represented by densities and some cannot. @@ -94,7 +94,7 @@ The benefit is that the density case offers a very direct parallel to the finite Once we've built some intuition we'll cover the general case. -### Definitions and Basic Properties +### Definitions and basic properties In our [lecture on finite Markov chains](https://python-intro.quantecon.org/finite_markov.html), we studied discrete-time Markov chains that evolve on a finite state space $S$. @@ -163,7 +163,7 @@ Letting $X_t = x$ in {eq}`statd_rw` and considering the distribution of $X_{t+1} In other words, $p$ is exactly $p_w$, as defined in {eq}`statd_rwsk`. -### Connection to Stochastic Difference Equations +### Connection to stochastic difference equations In the previous section, we made the connection between stochastic difference equation {eq}`statd_rw` and stochastic kernel {eq}`statd_rwsk`. @@ -276,7 +276,7 @@ where $\phi$ is the density of $A_{t+1}$. (Regarding the state space $S$ for this model, a natural choice is $(0, \infty)$ --- in which case $\sigma(x) = s f(x)$ is strictly positive for all $s$ as required) -### Distribution Dynamics +### Distribution dynamics In [this section](https://python.quantecon.org/finite_markov.html#marginal-distributions) of our lecture on **finite** Markov chains, we asked the following question: If @@ -513,7 +513,7 @@ converging --- more on this in just a moment. Another quick comment is that each of these distributions could be interpreted as a cross-sectional distribution (recall [this discussion](https://python.quantecon.org/finite_markov.html#example-2-cross-sectional-distributions)). -## Beyond Densities +## Beyond densities Up until now, we have focused exclusively on continuous state Markov chains where all conditional distributions $p(x, \cdot)$ are densities. @@ -529,7 +529,7 @@ be familiar with measure theory. We can, however, construct a fairly general theory using distribution functions. -### Example and Definitions +### Example and definitions To illustrate the issues, recall that Hopenhayn and Rogerson {cite}`HopenhaynRogerson1993` study a model of firm dynamics where individual firm productivity follows the exogenous process @@ -599,7 +599,7 @@ We will, however, treat only the density case (as in {ref}`this section ` is stable under mild conditions on the primitives. @@ -695,7 +695,7 @@ All sequences are converging towards the same limit, regardless of their initial The details regarding initial conditions and so on are given in {ref}`this exercise `, where you are asked to replicate the figure. -### Computing Stationary Densities +### Computing stationary densities In the preceding figure, each sequence of densities is converging towards the unique stationary density $\psi^*$. diff --git a/lectures/tax_smoothing_1.md b/lectures/tax_smoothing_1.md index 6b39ef12..fa7e6038 100644 --- a/lectures/tax_smoothing_1.md +++ b/lectures/tax_smoothing_1.md @@ -118,7 +118,7 @@ matrix Riccati equations that pin down $N$ value functions and $N$ linear decision rules, applying to the $N$ Markov states. -## Public Finance Questions +## Public finance questions {cite}`Barro1979` is designed to answer questions such as @@ -170,7 +170,7 @@ import numpy as np import matplotlib.pyplot as plt ``` -## Barro (1979) Model +## Barro (1979) model We begin by solving a version of {cite}`Barro1979` by mapping it into the original LQ framework. @@ -392,7 +392,7 @@ plt.ylabel('Govt Debt') plt.show() ``` -## Python Class to Solve Markov Jump Linear Quadratic Control Problems +## Python class to solve Markov jump linear quadratic control problems To implement the extension to the Barro model in which $p_{t,t+1}$ varies over time, we must allow the M matrix to be time-varying. @@ -415,7 +415,7 @@ Optimal $P_s,F_s,d_s$ are stored as attributes. The class also contains a method that simulates a model. -## Barro Model with a Time-varying Interest Rate +## 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. diff --git a/lectures/tax_smoothing_2.md b/lectures/tax_smoothing_2.md index 6dd217fd..fb046a17 100644 --- a/lectures/tax_smoothing_2.md +++ b/lectures/tax_smoothing_2.md @@ -91,7 +91,7 @@ We’ll describe two possible specifications - In the second, the government redesigns the maturity structure of the debt each period. -## One- and Two-period Bonds but No Restructuring +## One- and two-period bonds but no restructuring Let * $T_t$ denote tax collections @@ -165,7 +165,7 @@ Below, we will often adopt the convention that for matrices appearing in a linea $A_t \equiv A_{s_t}, C_t \equiv C_{s_t}$ and so on, so that dependence on $t$ is always intermediated through the Markov state $s_t$. -## Mapping into an LQ Markov Jump Problem +## Mapping into an LQ Markov jump problem First, define @@ -387,7 +387,7 @@ With the above function, we can proceed to solve the model in two steps: 1. Use the `LQMarkov` class to solve the resulting n-state Markov jump LQ problem. -## Penalty on Different Issues Across Maturities +## Penalty on different issues across maturities To implement a simple example of the two-period model, we assume that $G_t$ follows an AR(1) process: @@ -528,7 +528,7 @@ ax2.set_xlabel('Time') plt.show() ``` -## A Model with Restructuring +## A model with restructuring We now alter two features of the previous model: @@ -699,7 +699,7 @@ $$ This completes the mapping into a Markov jump LQ problem. -## Restructuring as a Markov Jump Linear Quadratic Control Problem +## Restructuring as a Markov jump linear quadratic control problem We can define a function that maps the primitives of the model with restructuring into the matrices required by the `LQMarkov` @@ -753,7 +753,7 @@ def LQ_markov_mapping_restruct(A22, C2, Ug, T, p_t, c=0): return A, B, C, R_c, Q_c, W_c ``` -### Example with Restructuring +### Example with restructuring As an example let $H = 3$. diff --git a/lectures/tax_smoothing_3.md b/lectures/tax_smoothing_3.md index 1f316980..c332bea9 100644 --- a/lectures/tax_smoothing_3.md +++ b/lectures/tax_smoothing_3.md @@ -62,7 +62,7 @@ import numpy as np import matplotlib.pyplot as plt ``` -## Roll-Over Risk +## Roll-over risk Let $T_t$ denote tax collections, $\beta$ a discount factor, $b_{t,t+1}$ time $t+1$ goods that the government promises to @@ -110,7 +110,7 @@ risk”. Specifically, we shut down the government’s ability to borrow in one of the Markov states. -## A Dead End +## A dead end A first thought for how to implement this might be to allow $p^t_{t+1}$ to vary over time with: @@ -144,7 +144,7 @@ cheap Thus, we must represent “roll-over risk” some other way. -## Better Representation of Roll-Over Risk +## Better representation of roll-over risk To force the government to set $b_{t,t+1} = 0$, we can instead extend the model to have four Markov states: diff --git a/lectures/troubleshooting.md b/lectures/troubleshooting.md index 35b6dc57..d1c03960 100644 --- a/lectures/troubleshooting.md +++ b/lectures/troubleshooting.md @@ -22,7 +22,7 @@ kernelspec: This page is for readers experiencing errors when running the code from the lectures. -## Fixing Your Local Environment +## Fixing your local environment The basic assumption of the lectures is that code in a lecture should execute whenever @@ -58,7 +58,7 @@ Second, you can report an issue, so we can try to fix your local set up. We like getting feedback on the lectures so please don't hesitate to get in touch. -## Reporting an Issue +## Reporting an issue One way to give feedback is to raise an issue through our [issue tracker](https://github.com/QuantEcon/lecture-python-advanced/issues). diff --git a/lectures/un_insure.md b/lectures/un_insure.md index e67f5b3b..ff8687ef 100644 --- a/lectures/un_insure.md +++ b/lectures/un_insure.md @@ -24,7 +24,7 @@ Weiss's model. Hopenhayn and Nicolini's model is a generalization of Shavell and Weiss's along dimensions that we'll soon describe. -## Shavell and Weiss's Model +## Shavell and Weiss's model An unemployed worker orders stochastic processes of consumption and search effort $\{c_t , a_t\}_{t=0}^\infty$ @@ -154,7 +154,7 @@ to compute $V^u_{j+1}$. * Iterate to convergence. -### Full Information +### Full information Another benchmark model helps set the stage for the model with private information that we ultimately want to study. @@ -253,7 +253,7 @@ during the unemployment spell. But the worker's consumption is not smoothed across states of employment and unemployment unless $V=V^e$. -### Incentive Problem +### Incentive problem The preceding efficient insurance scheme assumes that the insurance agency controls both $c$ and $a$. @@ -312,7 +312,7 @@ The full-information contract thus relies on the agency's ability to control *both* the unemployed worker's consumption *and* his search effort. -## Private Information +## Private information Following {cite}`Shavell_Weiss_79` and {cite}`Hopenhayn_Nicolini_97`, now assume that the unemployment insurance agency cannot @@ -415,7 +415,7 @@ unemployment. -### Computational Details +### Computational details It is useful to note that there are natural lower and upper bounds to the set @@ -494,7 +494,7 @@ where $c$ and $a$ are given by equations {eq}`eq:hugo21` and {eq}`eq:hugo22`. -### Python Computations +### Python computations We'll approximate the planner's optimal cost function with cubic splines. @@ -524,7 +524,7 @@ class params_instance: self.Ve = uw/(1-β) ``` -### Parameter Values +### Parameter values For the other parameters appearing in the above Python code, we'll calibrate parameter $r$ @@ -638,7 +638,7 @@ Now that we have calibrated our the parameter $r$, we can continue with solving +++ -### Computation under Private Information +### Computation under private information +++ @@ -796,7 +796,7 @@ a_star_interp = sp.interpolate.interp1d(Vu_grid,a_star) V_star_interp = sp.interpolate.interp1d(Vu_grid,V_star) ``` -### Replacement Ratios and Continuation Values +### Replacement ratios and continuation values +++