Skip to content

Commit 0a6b177

Browse files
committed
Merge branch 'main' of https://github.com/QuantEcon/lecture-python-intro into hyperinflate
2 parents 885b6ee + 87cadb9 commit 0a6b177

31 files changed

+242
-222
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
An undergraduate lecture series for the foundations of computational economics
44

5-
## Content Ideas
5+
## Content ideas
66

77
Content ideas in no particular order.
88

lectures/_static/lecture_specific/graphviz/graphviz_generation.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"id": "75d07327-0fcc-41f1-8d36-b8b8d4eb1060",
5555
"metadata": {},
5656
"source": [
57-
"## Lake Model"
57+
"## Lake model"
5858
]
5959
},
6060
{
@@ -101,7 +101,7 @@
101101
"id": "194ca10b-dd02-4210-adbc-c2bb8b699d45",
102102
"metadata": {},
103103
"source": [
104-
"## Markov Chains I\n",
104+
"## Markov chains I\n",
105105
"\n",
106106
"### Example 1\n",
107107
"\n",
@@ -202,7 +202,7 @@
202202
"id": "360e6241-2bdc-425e-903a-dab3c5ef0485",
203203
"metadata": {},
204204
"source": [
205-
"## Markov Chains II\n",
205+
"## Markov chains II\n",
206206
"\n",
207207
"### Irreducibility"
208208
]
@@ -330,7 +330,7 @@
330330
"id": "5df3cbb7-f540-4375-8448-c2aaa5526d56",
331331
"metadata": {},
332332
"source": [
333-
"### Markov Chains"
333+
"### Markov chains"
334334
]
335335
},
336336
{
@@ -375,7 +375,7 @@
375375
"id": "395fa1f8-6e8d-4ac5-bc71-f34b0b9c1e9c",
376376
"metadata": {},
377377
"source": [
378-
"### Poverty Trap"
378+
"### Poverty trap"
379379
]
380380
},
381381
{
@@ -456,7 +456,7 @@
456456
"id": "b43e5057-94eb-45e4-80e5-9f85a3c8be52",
457457
"metadata": {},
458458
"source": [
459-
"### Weighted Directed Graph"
459+
"### Weighted directed graph"
460460
]
461461
},
462462
{

lectures/_static/quant-econ.bib

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ @book{sargent2013rational
2121

2222

2323

24+
@book{cochrane2023fiscal,
25+
title={The Fiscal Theory of the Price Level},
26+
author={Cochrane, John H},
27+
year={2023},
28+
publisher={Princeton University Press},
29+
address={Princeton, New Jersey}
30+
}
31+
2432
@incollection{sargent1982ends,
2533
title={The ends of four big inflations},
2634
author={Sargent, Thomas J},

lectures/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ not essential.
5353
## Credits
5454

5555
In building this lecture series, we had invaluable assistance from research
56-
assistants at QuantEcon, as well as our QuantEcon colleagues. Without their
56+
assistants at QuantEcon, as well as our QuantEcon colleagues. Without their
5757
help this series would not have been possible.
5858

5959
In particular, we sincerely thank and give credit to

lectures/business_cycle.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ First we look at GDP growth.
9999
Let's source our data from the World Bank and clean it.
100100

101101
```{code-cell} ipython3
102-
# Use the series ID retrived before
102+
# Use the series ID retrieved before
103103
gdp_growth = wb.data.DataFrame('NY.GDP.MKTP.KD.ZG',
104104
['USA', 'ARG', 'GBR', 'GRC', 'JPN'],
105105
labels=True)
@@ -709,7 +709,7 @@ from 1919 to 2022 in the US to show this trend.
709709
---
710710
mystnb:
711711
figure:
712-
caption: "YoY real ouput change, US (%)"
712+
caption: "YoY real output change, US (%)"
713713
name: roc
714714
tags: [hide-input]
715715
---
@@ -733,7 +733,7 @@ ax.fill_between(nber.index, 0, 1,
733733
transform=ax.get_xaxis_transform(),
734734
label='NBER recession indicators')
735735
ax.set_ylim([ax.get_ylim()[0], ax.get_ylim()[1]])
736-
ax.set_ylabel('YoY real ouput change (%)')
736+
ax.set_ylabel('YoY real output change (%)')
737737
plt.show()
738738
```
739739

lectures/cagan_ree.md

Lines changed: 91 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ import matplotlib.pyplot as plt
3030
<!-- #region -->
3131
We'll use linear algebra first to explain and then do some experiments with a "fiscal theory of the price level".
3232

33+
A fiscal theory of the price level was described by Thomas Sargent and Neil Wallace in chapter 5 of
34+
a 1981 article title "Unpleasant Monetarist Arithmetic". The theory has been extended, criticized, and applied by John Cochrane in {cite}`cochrane2023fiscal`.
35+
36+
In another lecture, we'll describe some historical episodes in which the elemental forces at work in the fiscal theory help to explain some early twentieth century hyperinflations that occurred in the wake of World War I.
37+
3338

3439
According to this model, when the government persistently spends more than it collects in taxes and prints money to finance the shortfall (the "shortfall" is called the "government deficit"), it puts upward pressure on the price level and generates
3540
persistent inflation.
@@ -368,6 +373,86 @@ This is because the reduction in $\mu$ at $T_1$ has been foreseen from the start
368373
While the log money supply portrayed in the bottom panel has a kink at $T_1$, the log price level does not -- it is "smooth" -- once again a consequence of the fact that the
369374
reduction in $\mu$ has been foreseen.
370375
376+
To set the stage for our next experiment, we want to study the determinants of the price level a little more.
377+
378+
379+
### The log price level
380+
381+
We can use equations {eq}`eq:caganmd` and {eq}`eq:ree`
382+
to discover that the log of the price level satisfies
383+
384+
$$
385+
p_t = m_t + \alpha \pi_t
386+
$$ (eq:pformula2)
387+
388+
or, by using equation {eq}`eq:fisctheory1`,
389+
390+
$$
391+
p_t = m_t + \alpha \left[ (1-\delta) \sum_{s=t}^T \delta^{s-t} \mu_s + \delta^{T+1-t} \pi_{T+1}^* \right]
392+
$$ (eq:pfiscaltheory2)
393+
394+
In our next experiment, we'll study a "surprise" permanent change in the money growth that beforehand
395+
was completely unanticipated.
396+
397+
At time $T_1$ when the "surprise" money growth rate change occurs, to satisfy
398+
equation {eq}`eq:pformula2`, the log of real balances jumps
399+
**upward* as $\pi_t$ jumps **downward**.
400+
401+
But in order for $m_t - p_t$ to jump, which variable jumps, $m_{T_1}$ or $p_{T_1}$?
402+
403+
404+
### What jumps?
405+
406+
What jumps at $T_1$?
407+
408+
Is it $p_{T_1}$ or $m_{T_1}$?
409+
410+
411+
If we insist that the money supply $m_{T_1}$ is locked at its value $m_{T_1}^1$ inherited from the past, then formula {eq}`eq:pformula2` implies that the price level jumps downward at time $T_1$, to coincide with the downward jump in
412+
$\pi_{T_1}$
413+
414+
An alternative assumption about the money supply level is that as part of the "inflation stabilization",
415+
the government resets $m_{T_1}$ according to
416+
417+
$$
418+
m_{T_1}^2 - m_{T_1}^1 = \alpha (\pi^1 - \pi^2)
419+
$$ (eq:eqnmoneyjump)
420+
421+
By letting money jump according to equation {eq}`eq:eqnmoneyjump` the monetary authority prevents the price level from **falling** at the moment that the unanticipated stabilization arrives.
422+
423+
In various research papers about stabilizations of high inflations, the jump in the money supply described by equation {eq}`eq:eqnmoneyjump` has been called
424+
"the velocity dividend" that a government reaps from implementing a regime change that sustains a permanently lower inflation rate.
425+
426+
#### Technical details about whether $p$ or $m$ jumps at $T_1$
427+
428+
We have noted that with a constant expected forward sequence $\mu_s = \bar \mu$ for $s\geq t$, $\pi_{t} =\bar{\mu}$.
429+
430+
A consequence is that at $T_1$, either $m$ or $p$ must "jump" at $T_1$.
431+
432+
We'll study both cases.
433+
434+
#### $m_{T_{1}}$ does not jump.
435+
436+
$$
437+
\begin{align*}
438+
m_{T_{1}}&=m_{T_{1}-1}+\mu_{0}\\\pi_{T_{1}}&=\mu^{*}\\p_{T_{1}}&=m_{T_{1}}+\alpha\pi_{T_{1}}
439+
\end{align*}
440+
$$
441+
Simply glue the sequences $t\leq T_1$ and $t > T_1$.
442+
443+
#### $m_{T_{1}}$ jumps.
444+
445+
We reset $m_{T_{1}}$ so that $p_{T_{1}}=\left(m_{T_{1}-1}+\mu_{0}\right)+\alpha\mu_{0}$, with $\pi_{T_{1}}=\mu^{*}$.
446+
447+
Then,
448+
449+
$$
450+
m_{T_{1}}=p_{T_{1}}-\alpha\pi_{T_{1}}=\left(m_{T_{1}-1}+\mu_{0}\right)+\alpha\left(\mu_{0}-\mu^{*}\right)
451+
$$
452+
453+
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.
454+
455+
We are now technically equipped to discuss our next experiment.
371456
372457
#### Experiment 2: an unforeseen sudden stabilization
373458
@@ -390,7 +475,7 @@ To capture a "completely unanticipated permanent shock to the $\{\mu\}$ process
390475
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,
391476
T_1 -1$.
392477
393-
We can do the MIT shock calculations entirely by hand.
478+
We can do the MIT shock calculations mostly by hand.
394479
395480
Thus, for path 1, $\pi_t = \mu_0 $ for all $t \in [0, T_1-1]$, while for path 2,
396481
$\mu_s = \mu^*$ for all $s \geq T_1$.
@@ -399,7 +484,7 @@ We now move on to experiment 2, our "MIT shock", completely unforeseen
399484
sudden stabilization.
400485
401486
We set this up so that the $\{\mu_t\}$ sequences that describe the sudden stabilization
402-
are identical to those for experiment 1, the foreseen suddent stabilization.
487+
are identical to those for experiment 1, the foreseen sudden stabilization.
403488
404489
The following code does the calculations and plots outcomes.
405490
<!-- #endregion -->
@@ -523,17 +608,17 @@ ax[2].plot(T_seq, m_seq_1 - p_seq_1,
523608
ax[2].set_ylabel(r'$m - p$')
524609
525610
ax[3].plot(T_seq, m_seq_2_regime1,
526-
label=r'Unforseen (Insist on $m_{T_1}$)')
611+
label=r'Unforeseen (Smooth $m_{T_1}$)')
527612
ax[3].plot(T_seq, m_seq_2_regime2,
528-
label=r'Unforseen (Reset $m_{T_1}$)')
613+
label=r'Unforeseen ($m_{T_1}$ jumps)')
529614
ax[3].plot(T_seq, m_seq_1,
530615
label='Foreseen shock')
531616
ax[3].set_ylabel(r'$m$')
532617
533618
ax[4].plot(T_seq, p_seq_2_regime1,
534-
label=r'Unforseen (Insist on $m_{T_1}$)')
619+
label=r'Unforeseen (Smooth $m_{T_1}$)')
535620
ax[4].plot(T_seq, p_seq_2_regime2,
536-
label=r'Unforseen (Reset $m_{T_1}$)')
621+
label=r'Unforeseen ($m_{T_1}$ jumps)')
537622
ax[4].plot(T_seq, p_seq_1,
538623
label='Foreseen')
539624
ax[4].set_ylabel(r'$p$')
@@ -550,79 +635,6 @@ plt.show()
550635
551636
+++ {"user_expressions": []}
552637
553-
### The log price level
554-
555-
We can use equations {eq}`eq:caganmd` and {eq}`eq:ree`
556-
to discover that the log of the price level satisfies
557-
558-
$$
559-
p_t = m_t + \alpha \pi_t
560-
$$ (eq:pformula2)
561-
562-
or, by using equation {eq}`eq:fisctheory1`,
563-
564-
$$
565-
p_t = m_t + \alpha \left[ (1-\delta) \sum_{s=t}^T \delta^{s-t} \mu_s + \delta^{T+1-t} \pi_{T+1}^* \right]
566-
$$ (eq:pfiscaltheory2)
567-
568-
At time $T_1$ when the "surprise" regime change occurs, to satisfy
569-
equation {eq}`eq:pformula2`, the log of real balances jumps
570-
**upward* as $\pi_t$ jumps **downward**.
571-
572-
But in order for $m_t - p_t$ to jump, which variable jumps, $m_{T_1}$ or $p_{T_1}$?
573-
574-
575-
### What jumps?
576-
577-
What jumps at $T_1$?
578-
579-
Is it $p_{T_1}$ or $m_{T_1}$?
580-
581-
582-
If we insist that the money supply $m_{T_1}$ is locked at its value $m_{T_1}^1$ inherited from the past, then formula {eq}`eq:pformula2` implies that the price level jumps downward at time $T_1$, to coincide with the downward jump in
583-
$\pi_{T_1}$
584-
585-
An alternative assumption about the money supply level is that as part of the "inflation stabilization",
586-
the government resets $m_{T_1}$ according to
587-
588-
$$
589-
m_{T_1}^2 - m_{T_1}^1 = \alpha (\pi^1 - \pi^2)
590-
$$ (eq:eqnmoneyjump)
591-
592-
By letting money jump according to equation {eq}`eq:eqnmoneyjump` the monetary authority prevents the price level
593-
from **falling** at the moment that the unanticipated stabilization arrives.
594-
595-
In various research papers about stabilizations of high inflations, the jump in the money supply described by equation {eq}`eq:eqnmoneyjump` has been called
596-
"the velocity dividend" that a government reaps from implementing a regime change that sustains a permanently lower inflation rate.
597-
598-
#### Technical Details about whether $p$ or $m$ jumps at $T_1$
599-
600-
We have noted that with a constant expected forward sequence $\mu_s = \bar \mu$ for $s\geq t$, $\pi_{t} =\bar{\mu}$.
601-
602-
A consequence is that at $T_1$, either $m$ or $p$ must "jump" at $T_1$.
603-
604-
We'll study both cases.
605-
606-
#### $m_{T_{1}}$ does not jump.
607-
608-
$$
609-
\begin{align*}
610-
m_{T_{1}}&=m_{T_{1}-1}+\mu_{0}\\\pi_{T_{1}}&=\mu^{*}\\p_{T_{1}}&=m_{T_{1}}+\alpha\pi_{T_{1}}
611-
\end{align*}
612-
$$
613-
Simply glue the sequences $t\leq T_1$ and $t > T_1$.
614-
615-
#### $m_{T_{1}}$ jumps.
616-
617-
We reset $m_{T_{1}}$ so that $p_{T_{1}}=\left(m_{T_{1}-1}+\mu_{0}\right)+\alpha\mu_{0}$, with $\pi_{T_{1}}=\mu^{*}$.
618-
619-
Then,
620-
621-
$$
622-
m_{T_{1}}=p_{T_{1}}-\alpha\pi_{T_{1}}=\left(m_{T_{1}-1}+\mu_{0}\right)+\alpha\left(\mu_{0}-\mu^{*}\right)
623-
$$
624-
625-
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.
626638
627639
628640
#### Experiment 3

lectures/cobweb.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ plt.show()
9292

9393

9494

95-
## The Model
95+
## The model
9696

9797
Let's return to our discussion of a hypothetical soy bean market, where price is determined by supply and demand.
9898

@@ -196,7 +196,7 @@ Combining the last two equations gives the dynamics for prices:
196196
The price dynamics depend on the parameter values and also on the function $f$ that determines how producers form expectations.
197197

198198

199-
## Naive Expectations
199+
## Naive expectations
200200

201201
To go further in our analysis we need to specify the function $f$; that is, how expectations are formed.
202202

@@ -392,7 +392,7 @@ For example,
392392
ts_plot_price(m, 10, ts_length=15)
393393
```
394394

395-
## Adaptive Expectations
395+
## Adaptive expectations
396396

397397
Naive expectations are quite simple and also important in driving the cycle that we found.
398398

lectures/commod_price.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ from scipy.stats import beta
103103
```
104104

105105

106-
## The Model
106+
## The model
107107

108108
Consider a market for a single commodity, whose price is given at $t$ by
109109
$p_t$.

lectures/cons_smooth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ kernelspec:
1313

1414
+++ {"user_expressions": []}
1515

16-
# Consumption smoothing
16+
# Consumption Smoothing
1717

1818
## Overview
1919

0 commit comments

Comments
 (0)