Skip to content

Review lectures #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 23 additions & 26 deletions lectures/business_cycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ In this lecture we review some empirical aspects of business cycles.

Business cycles are fluctuations in economic activity over time.

The include expansions (also called booms) and contractions (also called recessions).
These include expansions (also called booms) and contractions (also called recessions).

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/).

In addition to those installed by Anaconda, this lecture requires
In addition to the packages already installed by Anaconda, this lecture requires

```{code-cell} ipython3
:tags: [hide-output]
Expand All @@ -50,7 +50,7 @@ Here's some minor code to help with colors in our plots.
```{code-cell} ipython3
:tags: [hide-input]

# Set Graphical Parameters
# Set graphical parameters
cycler = plt.cycler(linestyle=['-', '-.', '--', ':'],
color=['#377eb8', '#ff7f00', '#4daf4a', '#ff334f'])
plt.rc('axes', prop_cycle=cycler)
Expand All @@ -59,12 +59,12 @@ plt.rc('axes', prop_cycle=cycler)

## Data acquisition

We will use `wbgapi` and `pandas_datareader` to retrieve data.
We will use the World Bank's data API `wbgapi` and `pandas_datareader` to retrieve data.

We can use `wb.series.info` with the argument `q` to query available data from
the [World Bank](https://www.worldbank.org/en/home).

For example, let's retrieve the ID to query GDP growth data.
For example, let's retrieve the GDP growth data ID to query GDP growth data.

```{code-cell} ipython3
wb.series.info(q='GDP growth')
Expand All @@ -81,7 +81,7 @@ gdp_growth
```


We can the metadata to learn more about the series (click to expand).
We can look at the series' metadata to learn more about the series (click to expand).

```{code-cell} ipython3
:tags: [hide-output]
Expand Down Expand Up @@ -155,7 +155,7 @@ def plot_series(data, country, ylabel,

ax.plot(data.loc[country], label=country, **g_params)

# Highlight Recessions
# Highlight recessions
ax.axvspan(1973, 1975, **b_params)
ax.axvspan(1990, 1992, **b_params)
ax.axvspan(2007, 2009, **b_params)
Expand Down Expand Up @@ -248,7 +248,7 @@ Now let's consider Japan, which experienced rapid growth in the 1960s and
1970s, followed by slowed expansion in the past two decades.

Major dips in the growth rate coincided with the Oil Crisis of the 1970s, the
GFC and the Covid-19 pandemic.
Global Financial Crisis (GFC) and the Covid-19 pandemic.

```{code-cell} ipython3
---
Expand Down Expand Up @@ -311,7 +311,7 @@ plt.show()
Notice that Argentina has experienced far more volatile cycles than
the economies examined above.

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


Expand Down Expand Up @@ -413,12 +413,12 @@ The labor market recovered at an unprecedented rate after the shock in 2020-2021
In our {ref}`previous discussion<gdp_growth>`, we found that developed economies have had
relatively synchronized periods of recession.

At the same time, this synchronization does not appear in Argentina until the 2000s.
At the same time, this synchronization did not appear in Argentina until the 2000s.

Let's examine this trend further.

With slight modifications, we can use our previous function to draw a plot
that includes many countries
that includes multiple countries.

```{code-cell} ipython3
---
Expand Down Expand Up @@ -466,7 +466,7 @@ def plot_comparison(data, countries,
for country in countries:
ax.plot(data.loc[country], label=country, **g_params)

# Highlight Recessions
# Highlight recessions
ax.axvspan(1973, 1975, **b_params)
ax.axvspan(1990, 1992, **b_params)
ax.axvspan(2007, 2009, **b_params)
Expand Down Expand Up @@ -513,7 +513,7 @@ gdp_growth.columns = gdp_growth.columns.str.replace('YR', '').astype(int)

```

We use the United Kingdom, United States, Germany, and Japan as examples of developed economies
We use the United Kingdom, United States, Germany, and Japan as examples of developed economies.

```{code-cell} ipython3
---
Expand All @@ -534,7 +534,7 @@ plot_comparison(gdp_growth.loc[countries, 1962:],
plt.show()
```

We choose Brazil, China, Argentina, and Mexico as representative developing economies
We choose Brazil, China, Argentina, and Mexico as representative developing economies.

```{code-cell} ipython3
---
Expand All @@ -561,14 +561,14 @@ business cycles are becoming more synchronized in 21st-century recessions.
However, emerging and less developed economies often experience more volatile
changes throughout the economic cycles.

Despite of the synchronization in GDP growth, the experience of individual countries during
Despite the synchronization in GDP growth, the experience of individual countries during
the recession often differs.

We use unemployment rate and the recovery of labor market conditions
We use the unemployment rate and the recovery of labor market conditions
as another example.

Here we compare the unemployment rate of the United States,
United Kingdom, Japan, and France
the United Kingdom, Japan, and France.

```{code-cell} ipython3
---
Expand Down Expand Up @@ -597,7 +597,7 @@ plt.show()
We see that France, with its strong labor unions, typically experiences
relatively slow labor market recoveries after negative shocks.

We also notice that, Japan has a history of very low and stable unemployment rates.
We also notice that Japan has a history of very low and stable unemployment rates.


## Leading indicators and correlated factors
Expand Down Expand Up @@ -684,19 +684,18 @@ plt.show()

We see that

* consumer sentiment often remains high during during expansion and
drops before a recession.
* consumer sentiment often remains high during expansions and
drops before recessions.
* there is a clear negative correlation between consumer sentiment and the CPI.

When the price of consumer commodities rises, consumer confidence diminishes.

This trend is more significant in the during [stagflation](https://en.wikipedia.org/wiki/Stagflation).
This trend is more significant during [stagflation](https://en.wikipedia.org/wiki/Stagflation).



### Production


Real industrial output is highly correlated with recessions in the economy.

However, it is not a leading indicator, as the peak of contraction in production
Expand Down Expand Up @@ -751,7 +750,7 @@ activity and gloomy expectations for the future.
One example is domestic credit to the private sector by banks in the UK.

The following graph shows the domestic credit to the private sector as a
percentage of GDP by banks from 1970 to 2022 in the UK
percentage of GDP by banks from 1970 to 2022 in the UK.

```{code-cell} ipython3
---
Expand All @@ -777,7 +776,5 @@ ax = plot_series(private_credit, countries,
plt.show()
```


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

Loading