Skip to content

Commit 1a1e771

Browse files
authored
Merge pull request #200 from QuantEcon/misc_edits
Misc edits
2 parents 29b51fa + 997c3fb commit 1a1e771

File tree

5 files changed

+105
-114
lines changed

5 files changed

+105
-114
lines changed

lectures/business_cycle.md

Lines changed: 49 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,20 @@ kernelspec:
1111
name: python3
1212
---
1313

14-
+++ {"user_expressions": []}
1514

1615
# Business Cycles
1716

1817
## Overview
1918

20-
In this lecture we study business cycles
19+
In this lecture we review some empirical aspects of business cycles.
2120

2221
Business cycles are fluctuations in economic activity over time.
2322

24-
These fluctuations are in the form of expansions (booms), contractions (recessions), and recoveries.
23+
The include expansions (also called booms) and contractions (also called recessions).
2524

26-
We will look into a series of economic indicators to visualize the expansions and contractions of economies using [World Bank](https://documents.worldbank.org/en/publication/documents-reports/api) and [FRED](https://fred.stlouisfed.org/) data.
25+
For our study, we will use economic indicators from the [World Bank](https://documents.worldbank.org/en/publication/documents-reports/api) and [FRED](https://fred.stlouisfed.org/).
2726

2827
In addition to those installed by Anaconda, this lecture requires
29-
libraries to obtain World Bank and FRED data:
3028

3129
```{code-cell} ipython3
3230
:tags: [hide-output]
@@ -47,6 +45,8 @@ import wbgapi as wb
4745
import pandas_datareader.data as web
4846
```
4947

48+
Here's some minor code to help with colors in our plots.
49+
5050
```{code-cell} ipython3
5151
:tags: [hide-input]
5252
@@ -56,14 +56,10 @@ cycler = plt.cycler(linestyle=['-', '-.', '--', ':'],
5656
plt.rc('axes', prop_cycle=cycler)
5757
```
5858

59-
+++ {"user_expressions": []}
6059

6160
## Data acquisition
6261

63-
We will use `wbgapi` and `pandas_datareader` to retrieve data throughout this
64-
lecture.
65-
66-
Let's explore how to query data first.
62+
We will use `wbgapi` and `pandas_datareader` to retrieve data.
6763

6864
We can use `wb.series.info` with the argument `q` to query available data from
6965
the [World Bank](https://www.worldbank.org/en/home).
@@ -74,37 +70,31 @@ For example, let's retrieve the ID to query GDP growth data.
7470
wb.series.info(q='GDP growth')
7571
```
7672

77-
+++ {"user_expressions": []}
7873

7974
Now we use this series ID to obtain the data.
8075

8176
```{code-cell} ipython3
82-
:tags: [hide-output]
83-
8477
gdp_growth = wb.data.DataFrame('NY.GDP.MKTP.KD.ZG',
8578
['USA', 'ARG', 'GBR', 'GRC', 'JPN'],
8679
labels=True)
8780
gdp_growth
8881
```
8982

90-
+++ {"user_expressions": []}
9183

92-
We can the metadata to learn more about the series.
84+
We can the metadata to learn more about the series (click to expand).
9385

9486
```{code-cell} ipython3
9587
:tags: [hide-output]
9688
9789
wb.series.metadata.get('NY.GDP.MKTP.KD.ZG')
9890
```
9991

100-
+++ {"user_expressions": []}
10192

102-
Let's dive into the data with the tools we have.
10393

10494
(gdp_growth)=
10595
## GDP growth rate
10696

107-
First we look at the GDP growth rate.
97+
First we look at GDP growth.
10898

10999
Let's source our data from the World Bank and clean it.
110100

@@ -123,7 +113,7 @@ Here's a first look at the data
123113
gdp_growth
124114
```
125115

126-
Now we can write a function to generate plots for individual countries taking into account the recessions.
116+
We write a function to generate plots for individual countries taking into account the recessions.
127117

128118
```{code-cell} ipython3
129119
:tags: [hide-input]
@@ -199,9 +189,6 @@ t_params = {'color':'grey', 'fontsize': 9,
199189
'va':'center', 'ha':'center'}
200190
```
201191

202-
+++ {"user_expressions": []}
203-
204-
Now we can plot the data as a time series.
205192

206193
Let's start with the United States.
207194

@@ -299,7 +286,7 @@ plot_series(gdp_growth, country,
299286
plt.show()
300287
```
301288

302-
Greece had a significant drop in GDP growth around 2010-2011, during the peak
289+
Greece experienced a very large drop in GDP growth around 2010-2011, during the peak
303290
of the Greek debt crisis.
304291

305292
Next let's consider Argentina.
@@ -321,24 +308,18 @@ plot_series(gdp_growth, country,
321308
plt.show()
322309
```
323310

324-
+++ {"user_expressions": []}
325-
326-
The figure shows that Argentina has experienced more volatile cycles than
327-
the economies mentioned above.
311+
Notice that Argentina has experienced far more volatile cycles than
312+
the economies examined above.
328313

329314
At the same time, growth of Argentina did not fall during the two developed
330315
economy recessions in the 1970s and 1990s.
331316

332-
+++ {"user_expressions": []}
333317

334318
## Unemployment
335319

336320
Another important measure of business cycles is the unemployment rate.
337321

338-
During a recession, it is more likely that a larger proportion of the working
339-
population will be laid off.
340-
341-
We demonstrate this using a long-run unemployment rate from FRED spanning from [1929-1942](https://fred.stlouisfed.org/series/M0892AUSM156SNBR) to [1948-2022](https://fred.stlouisfed.org/series/UNRATE) with the unemployment rate between 1942 and 1948 estimated by the [Census Bureau](https://www.census.gov/library/publications/1975/compendia/hist_stats_colonial-1970.html).
322+
We study unemployment using rate data from FRED spanning from [1929-1942](https://fred.stlouisfed.org/series/M0892AUSM156SNBR) to [1948-2022](https://fred.stlouisfed.org/series/UNRATE), combined unemployment rate data over 1942-1948 estimated by the [Census Bureau](https://www.census.gov/library/publications/1975/compendia/hist_stats_colonial-1970.html).
342323

343324
```{code-cell} ipython3
344325
:tags: [hide-input]
@@ -358,7 +339,8 @@ unrate = web.DataReader('UNRATE', 'fred',
358339
start_date, end_date)
359340
```
360341

361-
Now we plot the long-run unemployment rate in the US from 1929 to 2022 with recession defined by NBER
342+
Let's plot the unemployment rate in the US from 1929 to 2022 with recessions
343+
defined by the NBER.
362344

363345
```{code-cell} ipython3
364346
---
@@ -411,24 +393,19 @@ ax.set_ylabel('unemployment rate (%)')
411393
plt.show()
412394
```
413395

414-
+++ {"user_expressions": []}
415-
416-
In the plot, we can see that the expansions and contractions of the labor
417-
market have been highly correlated with recessions.
418396

419-
However, there is often a delay in the recovery of the labor market after
420-
recessions.
397+
The plot shows that
421398

422-
This trend is clearly visible in the 1930s, as well as in recessions in the
423-
1980s.
399+
* expansions and contractions of the labor market have been highly correlated
400+
with recessions.
401+
* cycles are, in general, asymmetric: sharp rises in unemployment are followed
402+
by slow recoveries.
424403

425-
It also shows us how unique labor market conditions have been during the
404+
It also shows us how unique labor market conditions were in the US during the
426405
post-pandemic recovery.
427406

428-
The labor market has recovered at an unprecedented rate, leading to the
429-
tightest point in the past decades after the shock in 2020-2021.
407+
The labor market recovered at an unprecedented rate after the shock in 2020-2021.
430408

431-
+++ {"user_expressions": []}
432409

433410
(synchronization)=
434411
## Synchronization
@@ -577,9 +554,8 @@ plot_comparison(gdp_growth.loc[countries, 1962:],
577554
plt.show()
578555
```
579556

580-
+++ {"user_expressions": []}
581557

582-
The comparison of GDP growth rates above shows that
558+
The comparison of GDP growth rates above suggests that
583559
business cycles are becoming more synchronized in 21st-century recessions.
584560

585561
However, emerging and less developed economies often experience more volatile
@@ -618,42 +594,33 @@ plot_comparison(unempl_rate, countries,
618594
plt.show()
619595
```
620596

621-
France, with its strong labor unions, has a prolonged labor market recovery
622-
compared to the US and UK.
597+
We see that France, with its strong labor unions, typically experiences
598+
relatively slow labor market recoveries after negative shocks.
623599

624-
However, Japan has a history of very low and stable unemployment rates due to
625-
a constellation of social, demographic, and cultural factors.
600+
We also notice that, Japan has a history of very low and stable unemployment rates.
626601

627-
+++ {"user_expressions": []}
628602

629-
## Leading indicators and correlated factors for business cycles
603+
## Leading indicators and correlated factors
630604

631605
Examining leading indicators and correlated factors helps policymakers to
632606
understand the causes and results of business cycles.
633607

634608
We will discuss potential leading indicators and correlated factors from three
635609
perspectives: consumption, production, and credit level.
636610

637-
### Consumption
638611

639-
+++ {"user_expressions": []}
612+
### Consumption
640613

641614
Consumption depends on consumers' confidence towards their
642615
income and the overall performance of the economy in the future.
643616

644617
One widely cited indicator for consumer confidence is the [consumer sentiment index](https://fred.stlouisfed.org/series/UMCSENT) published by the University
645618
of Michigan.
646619

647-
Consumer sentiment remains high during during expansion, but there are significant drops before recession hits.
648-
649-
There is also a clear negative correlation between consumer sentiment and [core consumer price index](https://fred.stlouisfed.org/series/CPILFESL).
650-
651-
This trend is more significant in the during [stagflation](https://en.wikipedia.org/wiki/Stagflation).
652-
653-
When the price of consumer commodities rises, consumer confidence diminishes.
654-
655-
We plot the University of Michigan Consumer Sentiment Index and
656-
Year-over-year Consumer Price Index Change from 1978-2022 in the US to show this trend
620+
Here we plot the University of Michigan Consumer Sentiment Index and
621+
year-on-year
622+
[core consumer price index](https://fred.stlouisfed.org/series/CPILFESL)
623+
(CPI) change from 1978-2022 in the US.
657624

658625
```{code-cell} ipython3
659626
---
@@ -715,23 +682,28 @@ ax_t.set_ylabel('CPI YoY change (%)')
715682
plt.show()
716683
```
717684

718-
+++ {"user_expressions": []}
685+
We see that
719686

687+
* consumer sentiment often remains high during during expansion and
688+
drops before a recession.
689+
* there is a clear negative correlation between consumer sentiment and the CPI.
720690

721-
### Production
691+
When the price of consumer commodities rises, consumer confidence diminishes.
722692

723-
Consumers' confidence often influences their consumption pattern.
693+
This trend is more significant in the during [stagflation](https://en.wikipedia.org/wiki/Stagflation).
694+
695+
696+
697+
### Production
724698

725-
This often manifests on the production side.
726699

727-
The real industrial output is highly correlated with
728-
recessions in the economy.
700+
Real industrial output is highly correlated with recessions in the economy.
729701

730702
However, it is not a leading indicator, as the peak of contraction in production
731-
delays compared to consumer confidence and inflation.
703+
is delayed relative to consumer confidence and inflation.
732704

733705
We plot the real industrial output change from the previous year
734-
from 1919 to 2022 in the US to show this trend
706+
from 1919 to 2022 in the US to show this trend.
735707

736708
```{code-cell} ipython3
737709
---
@@ -767,20 +739,19 @@ plt.show()
767739

768740
We observe the delayed contraction in the plot across recessions.
769741

770-
+++ {"user_expressions": []}
771742

772743
### Credit level
773744

774745
Credit contractions often occur during recessions, as lenders become more
775746
cautious and borrowers become more hesitant to take on additional debt.
776747

777-
This can be due to several factors such as a decrease in overall economic
778-
activity, rising unemployment, and gloomy expectations for the future.
748+
This is due to factors such as a decrease in overall economic
749+
activity and gloomy expectations for the future.
779750

780751
One example is domestic credit to the private sector by banks in the UK.
781752

782-
The following graph shows the domestic credit to the private sector
783-
as a percentage of GDP by banks from 1970 to 2022 in the UK
753+
The following graph shows the domestic credit to the private sector as a
754+
percentage of GDP by banks from 1970 to 2022 in the UK
784755

785756
```{code-cell} ipython3
786757
---
@@ -806,11 +777,7 @@ ax = plot_series(private_credit, countries,
806777
plt.show()
807778
```
808779

809-
+++ {"user_expressions": []}
810780

811781
Note that the credit rises during economic expansion
812782
and stagnates or even contracts after recessions.
813783

814-
```{code-cell} ipython3
815-
816-
```

lectures/eigen_I.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ kernelspec:
2525

2626
## Overview
2727

28-
Eigenvalues and eigenvectors are an advanced topic in linear and
29-
matrix algebra.
28+
Eigenvalues and eigenvectors are a relatively advanced topic in linear algebra.
3029

3130
At the same time, these concepts are extremely useful for
3231

@@ -38,8 +37,8 @@ At the same time, these concepts are extremely useful for
3837

3938
In this lecture we explain the basics of eigenvalues and eigenvectors.
4039

41-
We assume in this lecture that students are familiar with matrices and
42-
understand the basics of matrix algebra.
40+
We assume in this lecture that students are familiar with matrices
41+
and understand {doc}`the basics of matrix algebra<linear_equations>`.
4342

4443
We will use the following imports:
4544

@@ -54,7 +53,6 @@ from matplotlib.patches import FancyArrowPatch
5453
from mpl_toolkits.mplot3d import proj3d
5554
```
5655

57-
+++ {"user_expressions": []}
5856

5957
(matrices_as_transformation)=
6058
## Matrices as transformations
@@ -63,10 +61,10 @@ Let's start by discussing an important concept concerning matrices.
6361

6462
### Mapping vectors into vectors
6563

66-
One way to think about a given matrix is as a rectangular collection of
64+
One way to think about a matrix is as a rectangular collection of
6765
numbers.
6866

69-
Another way to think about a matrix is as a **map** (i.e., as a function) that
67+
Another way to think about a matrix is as a *map* (i.e., as a function) that
7068
transforms vectors into new vectors.
7169

7270
To understand the second point of view, suppose we multiply an $n \times m$

0 commit comments

Comments
 (0)