Skip to content

Commit

Permalink
Merge pull request #241 from QuantEcon/in_line_with_manual
Browse files Browse the repository at this point in the history
In line with manual
  • Loading branch information
jstac authored Jun 15, 2023
2 parents e455682 + a7d57a5 commit c70d0b6
Show file tree
Hide file tree
Showing 28 changed files with 126 additions and 126 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

An undergraduate lecture series for the foundations of computational economics

## Content Ideas
## Content ideas

Content ideas in no particular order.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"id": "75d07327-0fcc-41f1-8d36-b8b8d4eb1060",
"metadata": {},
"source": [
"## Lake Model"
"## Lake model"
]
},
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"id": "194ca10b-dd02-4210-adbc-c2bb8b699d45",
"metadata": {},
"source": [
"## Markov Chains I\n",
"## Markov chains I\n",
"\n",
"### Example 1\n",
"\n",
Expand Down Expand Up @@ -202,7 +202,7 @@
"id": "360e6241-2bdc-425e-903a-dab3c5ef0485",
"metadata": {},
"source": [
"## Markov Chains II\n",
"## Markov chains II\n",
"\n",
"### Irreducibility"
]
Expand Down Expand Up @@ -330,7 +330,7 @@
"id": "5df3cbb7-f540-4375-8448-c2aaa5526d56",
"metadata": {},
"source": [
"### Markov Chains"
"### Markov chains"
]
},
{
Expand Down Expand Up @@ -375,7 +375,7 @@
"id": "395fa1f8-6e8d-4ac5-bc71-f34b0b9c1e9c",
"metadata": {},
"source": [
"### Poverty Trap"
"### Poverty trap"
]
},
{
Expand Down Expand Up @@ -456,7 +456,7 @@
"id": "b43e5057-94eb-45e4-80e5-9f85a3c8be52",
"metadata": {},
"source": [
"### Weighted Directed Graph"
"### Weighted directed graph"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion lectures/cagan_ree.md
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ from **falling** at the moment that the unanticipated stabilization arrives.
In various research papers about stabilizations of high inflations, the jump in the money supply described by equation {eq}`eq:eqnmoneyjump` has been called
"the velocity dividend" that a government reaps from implementing a regime change that sustains a permanently lower inflation rate.
#### Technical Details about whether $p$ or $m$ jumps at $T_1$
#### Technical details about whether $p$ or $m$ jumps at $T_1$
We have noted that with a constant expected forward sequence $\mu_s = \bar \mu$ for $s\geq t$, $\pi_{t} =\bar{\mu}$.
Expand Down
6 changes: 3 additions & 3 deletions lectures/cobweb.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ plt.show()



## The Model
## The model

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

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


## Naive Expectations
## Naive expectations

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

Expand Down Expand Up @@ -392,7 +392,7 @@ For example,
ts_plot_price(m, 10, ts_length=15)
```

## Adaptive Expectations
## Adaptive expectations

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

Expand Down
2 changes: 1 addition & 1 deletion lectures/commod_price.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ from scipy.stats import beta
```


## The Model
## The model

Consider a market for a single commodity, whose price is given at $t$ by
$p_t$.
Expand Down
2 changes: 1 addition & 1 deletion lectures/cons_smooth.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kernelspec:

+++ {"user_expressions": []}

# Consumption smoothing
# Consumption Smoothing

## Overview

Expand Down
12 changes: 6 additions & 6 deletions lectures/eigen_II.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ We can then take transpose to obtain $A^\top w = \lambda w$ and obtain $w^\top A
This is a more common expression and where the name left eigenvectors originates.

(perron-frobe)=
### The Perron-Frobenius Theorem
### The Perron-Frobenius theorem

For a square nonnegative matrix $A$, the behavior of $A^k$ as $k \to \infty$ is controlled by the eigenvalue with the largest
absolute value, often called the **dominant eigenvalue**.
Expand Down Expand Up @@ -478,7 +478,7 @@ $$
$$
```

We can see the Neumann series lemma in action in the following example.
We can see the Neumann Series Lemma in action in the following example.

```{code-cell} ipython3
A = np.array([[0.4, 0.1],
Expand All @@ -492,7 +492,7 @@ print(r)

The spectral radius $r(A)$ obtained is less than 1.

Thus, we can apply the Neumann Series lemma to find $(I-A)^{-1}$.
Thus, we can apply the Neumann Series Lemma to find $(I-A)^{-1}$.

```{code-cell} ipython3
I = np.identity(2) #2 x 2 identity matrix
Expand All @@ -518,7 +518,7 @@ np.allclose(A_sum, B_inverse)
```

Although we truncate the infinite sum at $k = 50$, both methods give us the same
result which illustrates the result of the Neumann Series lemma.
result which illustrates the result of the Neumann Series Lemma.

## Exercises

Expand Down Expand Up @@ -583,7 +583,7 @@ The solution $x^{*}$ is given by the equation $x^{*} = (I-A)^{-1} d$

1. Since $A$ is a nonnegative irreducible matrix, find the Perron-Frobenius eigenvalue of $A$.

2. Use the Neumann Series lemma to find the solution $x^{*}$ if it exists.
2. Use the Neumann Series Lemma to find the solution $x^{*}$ if it exists.

```{exercise-end}
```
Expand All @@ -603,7 +603,7 @@ r = max(abs(λ) for λ in evals) #dominant eigenvalue/spectral radius
print(r)
```

Since we have $r(A) < 1$ we can thus find the solution using the Neumann Series lemma.
Since we have $r(A) < 1$ we can thus find the solution using the Neumann Series Lemma.

```{code-cell} ipython3
I = np.identity(3)
Expand Down
2 changes: 1 addition & 1 deletion lectures/equalizing_difference.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ $$
$$


## Tweaked Model: Workers and Entrepreneurs
## Tweaked model: workers and entrepreneurs


We can add a parameter and reinterpret variables to get a model of entrepreneurs versus workers.
Expand Down
18 changes: 9 additions & 9 deletions lectures/geom_series.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
```

## Key Formulas
## Key formulas

To start, let $c$ be a real number that lies strictly between
$-1$ and $1$.
Expand All @@ -73,7 +73,7 @@ $-1$ and $1$.

We want to evaluate geometric series of two types -- infinite and finite.

### Infinite Geometric Series
### Infinite geometric series

The first type of geometric that interests us is the infinite series

Expand All @@ -95,7 +95,7 @@ To prove key formula {eq}`infinite`, multiply both sides by $(1-c)$ and verify
that if $c \in (-1,1)$, then the outcome is the
equation $1 = 1$.

### Finite Geometric Series
### Finite geometric series

The second series that interests us is the finite geometric series

Expand Down Expand Up @@ -148,7 +148,7 @@ money (i.e., deposits) in a fractional reserve system.
The geometric series formula {eq}`infinite` is at the heart of the classic model of the money creation process -- one that leads us to the celebrated
**money multiplier**.

### A Simple Model
### A simple model

There is a set of banks named $i = 0, 1, 2, \ldots$.

Expand Down Expand Up @@ -254,7 +254,7 @@ $i=0, 1, 2, \ldots$ is
\sum_{i=0}^\infty (1-r)^i D_0 = \frac{D_0}{1 - (1-r)} = \frac{D_0}{r}
```

### Money Multiplier
### Money multiplier

The **money multiplier** is a number that tells the multiplicative
factor by which an exogenous injection of cash into bank $0$ leads
Expand All @@ -280,7 +280,7 @@ circumstances in which
equal demand** (e.g., prices and interest rates are frozen)
- national income is entirely determined by aggregate demand

### Static Version
### Static version

An elementary Keynesian model of national income determination consists
of three equations that describe aggregate demand for $y$ and its
Expand Down Expand Up @@ -342,7 +342,7 @@ The expression $\sum_{t=0}^\infty b^t$ motivates an interpretation
of the multiplier as the outcome of a dynamic process that we describe
next.

### Dynamic Version
### Dynamic version

We arrive at a dynamic version by interpreting the nonnegative integer
$t$ as indexing time and changing our specification of the
Expand Down Expand Up @@ -543,7 +543,7 @@ It follows that
So if someone has a claim on $x$ dollars at time $t+j$, it
is worth $x R^{-j}$ dollars at time $t$ (e.g., today).

### Application to Asset Pricing
### Application to asset pricing

A **lease** requires a payments stream of $x_t$ dollars at
times $t = 0, 1, 2, \ldots$ where
Expand Down Expand Up @@ -855,7 +855,7 @@ so $\frac{\partial p_0}{\partial r}$ will always be negative.
Similarly, $\frac{\partial p_0}{\partial g}>0$ as long as $r>g$, $r>0$ and $g>0$ and $x_0$ is positive, so $\frac{\partial p_0}{\partial g}$
will always be positive.

## Back to the Keynesian Multiplier
## Back to the Keynesian multiplier

We will now go back to the case of the Keynesian multiplier and plot the
time path of $y_t$, given that consumption is a constant fraction
Expand Down
16 changes: 8 additions & 8 deletions lectures/inequality.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In this section we
* provide motivation for the techniques deployed in the lecture and
* import code libraries needed for our work.

### Some History
### Some history

Many historians argue that inequality played a key role in the fall of the
Roman republic.
Expand Down Expand Up @@ -82,7 +82,7 @@ import random as rd
from interpolation import interp
```

## The Lorenz Curve
## The Lorenz curve

One popular measure of inequality is the Lorenz curve.

Expand Down Expand Up @@ -126,7 +126,7 @@ income, consumption, etc.

+++

### Lorenz Curves of Simulated Data
### Lorenz curves of simulated data

Let's look at some examples and try to build understanding.

Expand Down Expand Up @@ -168,7 +168,7 @@ ax.set_xlim((0, 1))
plt.show()
```

### Lorenz Curves for US Data
### Lorenz curves for US data

Next let's look at the real data, focusing on income and wealth in the US in
2016.
Expand Down Expand Up @@ -265,7 +265,7 @@ more extreme than income inequality.

+++

## The Gini Coefficient
## The Gini coefficient

The Lorenz curve is a useful visual representation of inequality in a
distribution.
Expand Down Expand Up @@ -332,7 +332,7 @@ ax.text(0.04, 0.5, r'$G = 2 \times$ shaded area', fontsize=12)
plt.show()
```

### Gini Coefficient Dynamics of Simulated Data
### Gini coefficient dynamics of simulated data

Let's examine the Gini coefficient in some simulations.

Expand Down Expand Up @@ -399,7 +399,7 @@ coefficient.

+++

### Gini Coefficient Dynamics for US Data
### Gini coefficient dynamics for US data

Now let's look at Gini coefficients for US data derived from the SCF.

Expand Down Expand Up @@ -503,7 +503,7 @@ substantially since 1980.
The wealth time series exhibits a strong U-shape.


## Top Shares
## Top shares

Another popular measure of inequality is the top shares.

Expand Down
4 changes: 2 additions & 2 deletions lectures/input_output.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ plt.show()
+++ {"user_expressions": []}
## Leontief Inverse
## Leontief inverse
We have discussed that gross ouput $x$ is given by {eq}`eq:inout_2`, where $L$ is called the Leontief Inverse.
Expand All @@ -515,7 +515,7 @@ $$
This illustrates that an element $l_{ij}$ of $L$ shows the total impact on sector $i$ of a unit change in demand of good $j$.
## Applications of Graph Theory
## Applications of graph theory
We can further study input output networks through applications of {doc}`graph theory <networks>`.
Expand Down
10 changes: 5 additions & 5 deletions lectures/intro_supply_demand.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import matplotlib.pyplot as plt
```


## Supply and Demand
## Supply and demand

We study a market for a single good in which buyers and sellers exchange a quantity $q$ for a price $p$.

Expand Down Expand Up @@ -130,7 +130,7 @@ plt.show()



### Consumer Surplus
### Consumer surplus

Let a quantity $q$ be given and let $p := d_0 - d_1 q$ be the
corresponding price on the inverse demand curve.
Expand Down Expand Up @@ -195,7 +195,7 @@ $$



### Producer Surplus
### Producer surplus

Let a quantity $q$ be given and let $p := s_0 + s_1 q$ be the
corresponding price on the inverse supply curve.
Expand Down Expand Up @@ -256,7 +256,7 @@ $$
$$


### Social Welfare
### Social welfare

Sometimes economists measure social welfare by a **welfare criterion** that
equals consumer surplus plus producer surplus, assuming that consumers and
Expand Down Expand Up @@ -318,7 +318,7 @@ We'll compare it to the quantity that emerges in a competitive equilibrium that
### Competitive Equilibrium
### Competitive equilibrium
Instead of equating quantities supplied and demanded, we can accomplish the
same thing by equating demand price to supply price:
Expand Down
Loading

0 comments on commit c70d0b6

Please sign in to comment.