Skip to content

Commit 9aac3e8

Browse files
committed
fix code blocks
1 parent 54f82f7 commit 9aac3e8

File tree

1 file changed

+54
-40
lines changed

1 file changed

+54
-40
lines changed

lectures/cagan_ree.md

Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
1-
## A Fiscal Theory of the Price Level
1+
---
2+
jupytext:
3+
text_representation:
4+
extension: .md
5+
format_name: myst
6+
format_version: 0.13
7+
jupytext_version: 1.14.5
8+
kernelspec:
9+
display_name: Python 3 (ipykernel)
10+
language: python
11+
name: python3
12+
---
213

14+
+++ {"user_expressions": []}
315

4-
### Introduction
16+
# A Fiscal Theory of the Price Level
17+
18+
## Introduction
519

620
As usual, we'll start by importing some Python modules.
721

8-
```python
22+
```{code-cell} ipython3
923
import numpy as np
1024
import matplotlib.pyplot as plt
1125
```
1226

27+
+++ {"user_expressions": []}
28+
1329
<!-- #region -->
1430
We'll use linear algebra first to explain and then do some experiments with a "fiscal theory of the price level".
1531

@@ -38,7 +54,7 @@ As in several other lectures, the only linear algebra that we'll be using
3854
are matrix multplication and matrix inversion.
3955

4056

41-
### Structure of the Model
57+
## Structure of the Model
4258

4359

4460
The model consists of
@@ -183,7 +199,7 @@ Equation {eq}`eq:mcum` shows that the log of the money supply at $t$ equals the
183199
plus accumulation of rates of money growth between times $0$ and $t$.
184200
185201
186-
### Continuation values
202+
## Continuation values
187203
188204
189205
To determine the continuation inflation rate $\pi_{T+1}^*$ we shall proceed by applying the following infinite-horizon
@@ -230,7 +246,7 @@ $$
230246
231247
so that, in terms of our notation and formula for $\theta_{T+1}^*$ above, $\tilde \gamma = 1$.
232248
233-
#### Experiment 1: foreseen sudden stabilization
249+
#### Experiment 1: foreseen sudden stabilization
234250
235251
In this experiment, we'll study how, when $\alpha >0$, a foreseen inflation stabilization has effects on inflation that proceed it.
236252
@@ -259,8 +275,6 @@ Such a completely unanticipated shock is popularly known as an "MIT shock".
259275
260276
The mental experiment involves switching at at time $T_1$ from an initial "continuation path" for $\{\mu_t, \pi_t\} $ to another path that involves a permanently lower inflation frate.
261277
262-
263-
264278
**Initial Path:** $\mu_t = \mu_0$ for all $t \geq 0$. So this path is for $\{\mu_t\}_{t=0}^\infty$; the associated
265279
path for $\pi_t$ has $\pi_t = \mu_0$.
266280
@@ -272,17 +286,12 @@ To capture a "completely unanticipated permanent shock to the $\{\mu\}$ process
272286
that emerges under path 2 for $t \geq T_1$ to the $\mu_t, \pi_t$ path that had emerged under path 1 for $ t=0, \ldots,
273287
T_1 -1$.
274288
275-
276289
We can do the MIT shock calculations entirely by hand.
277290
278291
Thus, for path 1, $\pi_t = \mu_0 $ for all $t \in [0, T_1-1]$, while for path 2,
279292
$\mu_s = \mu^*$ for all $s \geq T_1$.
280293
281-
282-
283-
284-
#### The log price level
285-
294+
### The log price level
286295
287296
We can use equations {eq}`eq:caganmd` and {eq}`eq:ree`
288297
to discover that the log of the price level satisfies
@@ -304,7 +313,7 @@ equation {eq}`eq:pformula2`, the log of real balances jumps
304313
But in order for $m_t - p_t$ to jump, which variable jumps, $m_{T_1}$ or $p_{T_1}$?
305314
306315
307-
#### What jumps?
316+
### What jumps?
308317
309318
What jumps at $T_1$?
310319
@@ -329,8 +338,6 @@ In various research papers about stabilizations of high inflations, the jump in
329338
330339
#### Technical Details about whether $p$ or $m$ jumps at $T_1$
331340
332-
333-
334341
We have noted that with a constant expected forward sequence $\mu_s = \bar \mu$ for $s\geq t$, $\pi_{t} =\bar{\mu}$.
335342
336343
A consequence is that at $T_1$, either $m$ or $p$ must "jump" at $T_1$.
@@ -355,9 +362,6 @@ $$ m_{T_{1}}=p_{T_{1}}-\alpha\pi_{T_{1}}=\left(m_{T_{1}-1}+\mu_{0}\right)+\alpha
355362
We then compute for the remaining $T-T_{1}$ periods with $\mu_{s}=\mu^{*},\forall s\geq T_{1}$ and the initial condition $m_{T_{1}}$ from above.
356363

357364

358-
359-
360-
361365
#### Experiment 3
362366

363367
**Foreseen gradual stabilization**
@@ -376,7 +380,7 @@ $$
376380
Let's prepare a Python class to perform our experiments by implementing our formulas using linear algebra
377381
<!-- #endregion -->
378382

379-
```python
383+
```{code-cell} ipython3
380384
class Cagan_REE:
381385
" Solve the rational expectation version of Cagan model in finite time. "
382386
@@ -415,7 +419,7 @@ def solve_and_plot(m0, α, T, μ_seq):
415419
T_seq = range(T+2)
416420
417421
418-
fig, ax = plt.subplots(2, 3, figsize=[10,5], dpi=200)
422+
fig, ax = plt.subplots(2, 3, figsize=[10, 5], dpi=200)
419423
ax[0,0].plot(T_seq[:-1], μ_seq)
420424
ax[0,1].plot(T_seq, π_seq)
421425
ax[0,2].plot(T_seq, m_seq - p_seq)
@@ -427,7 +431,7 @@ def solve_and_plot(m0, α, T, μ_seq):
427431
ax[0,1].set_ylabel(r'$\pi$')
428432
ax[0,1].set_xlabel(r'$t$')
429433
ax[0,2].set_xlabel(r'$t$')
430-
ax[0,2].set_ylabel(r'$m - p}$')
434+
ax[0,2].set_ylabel(r'$m - p$')
431435
ax[1,0].set_ylabel(r'$m$')
432436
ax[1,0].set_xlabel(r'$t$')
433437
ax[1,1].set_ylabel(r'$p$')
@@ -440,7 +444,7 @@ def solve_and_plot(m0, α, T, μ_seq):
440444
return π_seq, m_seq, p_seq
441445
```
442446

443-
```python
447+
```{code-cell} ipython3
444448
# parameters
445449
T = 80
446450
T1 = 60
@@ -451,19 +455,23 @@ m0 = 1
451455
μ_star = 0
452456
```
453457

458+
+++ {"user_expressions": []}
459+
454460
### Experiment 1
455461

456462
We'll start by executing a version of our "experiment 1" in which the government implements a **foreseen** sudden permanent reduction in the rate of money creation at time $T_1$.
457463

458464
The following code performs the experiment and plots outcomes.
459465

460-
```python
466+
```{code-cell} ipython3
461467
μ_seq_1 = np.append(μ0*np.ones(T1+1), μ_star*np.ones(T-T1))
462468
463469
# solve and plot
464470
π_seq_1, m_seq_1, p_seq_1 = solve_and_plot(m0=m0, α=α, T=T, μ_seq=μ_seq_1)
465471
```
466472

473+
+++ {"user_expressions": []}
474+
467475
The plot of the money growth rate $\mu_t$ in the top level panel portrays
468476
a sudden reduction from $.5$ to $0$ at time $T_1 = 60$.
469477

@@ -491,7 +499,7 @@ are identical to those for experiment 1, the foreseen suddent stabilization.
491499
The following code does the calculations and plots outcomes.
492500
<!-- #endregion -->
493501

494-
```python
502+
```{code-cell} ipython3
495503
# path 1
496504
μ_seq_3_path1 = μ0 * np.ones(T+1)
497505
@@ -519,27 +527,29 @@ mc = Cagan_REE(m0=m_T1, α=α, T=T-1-T1, μ_seq=μ_seq_3_cont)
519527
520528
m_seq_3_regime2 = np.concatenate([m_seq_3_path1[:T1+1], m_seq_3_cont2])
521529
p_seq_3_regime2 = np.concatenate([p_seq_3_path1[:T1+1], p_seq_3_cont2])
522-
```
523530
524-
```python
525531
T_seq = range(T+2)
526532
527533
# plot both regimes
528534
fig, ax = plt.subplots(2, 3, figsize=[10,5], dpi=200)
529-
ax[0,0].plot(T_seq[:-1], μ_seq_3)
530-
ax[0,1].plot(T_seq, π_seq_3)
531-
ax[0,2].plot(T_seq, m_seq_3_regime1 - p_seq_3_regime1)
532-
ax[1,0].plot(T_seq, m_seq_3_regime1, label='Smooth $m_{T_1}$')
533-
ax[1,0].plot(T_seq, m_seq_3_regime2, label='Jumpy $m_{T_1}$')
534-
ax[1,1].plot(T_seq, p_seq_3_regime1, label='Smooth $m_{T_1}$')
535-
ax[1,1].plot(T_seq, p_seq_3_regime2, label='Jumpy $m_{T_1}$')
535+
536+
for i in range(2):
537+
for i in range(3):
538+
539+
ax[0,0].plot(T_seq[:-1], μ_seq_3)
540+
ax[0,1].plot(T_seq, π_seq_3)
541+
ax[0,2].plot(T_seq, m_seq_3_regime1 - p_seq_3_regime1)
542+
ax[1,0].plot(T_seq, m_seq_3_regime1, label='Smooth $m_{T_1}$')
543+
ax[1,0].plot(T_seq, m_seq_3_regime2, label='Jumpy $m_{T_1}$')
544+
ax[1,1].plot(T_seq, p_seq_3_regime1, label='Smooth $m_{T_1}$')
545+
ax[1,1].plot(T_seq, p_seq_3_regime2, label='Jumpy $m_{T_1}$')
536546
537547
ax[0,0].set_ylabel(r'$\mu$')
538548
ax[0,0].set_xlabel(r'$t$')
539549
ax[0,1].set_ylabel(r'$\pi$')
540550
ax[0,1].set_xlabel(r'$t$')
541551
ax[0,2].set_xlabel(r'$t$')
542-
ax[0,2].set_ylabel(r'$m - p}$')
552+
ax[0,2].set_ylabel(r'$m - p$')
543553
ax[1,0].set_ylabel(r'$m$')
544554
ax[1,0].set_xlabel(r'$t$')
545555
ax[1,1].set_ylabel(r'$p$')
@@ -553,6 +563,8 @@ plt.tight_layout()
553563
plt.show()
554564
```
555565

566+
+++ {"user_expressions": []}
567+
556568
We invite you to compare these graphs with corresponding ones for the foreseen stabilization analyzed in experiment 1 above.
557569

558570
Note how the inflation graph in the top middle panel is now identical to the
@@ -575,7 +587,7 @@ The next code generates a multi-panel graph that includes outcomes of both exper
575587
That allows us to assess how important it is to understand whether the sudden permanent drop in $\mu_t$ at $t=T_1$ is fully unanticipated, as in experiment 1, or completely
576588
unanticipated, as in experiment 2.
577589

578-
```python
590+
```{code-cell} ipython3
579591
T_seq = range(T+2)
580592
581593
# plot both regimes
@@ -593,7 +605,7 @@ ax[0,0].set_xlabel(r'$t$')
593605
ax[0,1].set_ylabel(r'$\pi$')
594606
ax[0,1].set_xlabel(r'$t$')
595607
ax[0,2].set_xlabel(r'$t$')
596-
ax[0,2].set_ylabel(r'$m - p}$')
608+
ax[0,2].set_ylabel(r'$m - p$')
597609
ax[1,0].set_ylabel(r'$m$')
598610
ax[1,0].set_xlabel(r'$t$')
599611
ax[1,1].set_ylabel(r'$p$')
@@ -607,13 +619,15 @@ plt.tight_layout()
607619
plt.show()
608620
```
609621

622+
+++ {"user_expressions": []}
623+
610624
### Experiment 3
611625

612626
Next we perform an experiment in which there is a perfectly foreseen **gradual** decrease in the rate of growth of the money supply.
613627

614628
The following code does the calculations and plots the results.
615629

616-
```python
630+
```{code-cell} ipython3
617631
# parameters
618632
ϕ = 0.9
619633
μ_seq_2 = np.array([ϕ**t * μ0 + (1-ϕ**t)*μ_star for t in range(T)])
@@ -624,7 +638,7 @@ The following code does the calculations and plots the results.
624638
π_seq_2, m_seq_2, p_seq_2 = solve_and_plot(m0=m0, α=α, T=T, μ_seq=μ_seq_2)
625639
```
626640

627-
```python
641+
```{code-cell} ipython3
628642
# compare foreseen vs unforeseen shock
629643
fig, ax = plt.subplots(2, 3, figsize=[12,6], dpi=200)
630644
ax[0,0].plot(T_seq[:-1], μ_seq_3)

0 commit comments

Comments
 (0)