Skip to content

Commit 2b8880d

Browse files
committed
fix headings
1 parent 571ca2a commit 2b8880d

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

lectures/cons_smooth.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ kernelspec:
1111
name: python3
1212
---
1313

14-
+++ {"user_expressions": []}
15-
16-
## Some dynamic models with matrices
14+
# Some dynamic models with matrices
1715

1816
In this notebook, we'll present some useful models of economic dynamics using only linear algebra -- matrix multiplication and matrix inversion.
1917

@@ -24,8 +22,6 @@ import numpy as np
2422
import matplotlib.pyplot as plt
2523
```
2624

27-
+++ {"user_expressions": []}
28-
2925
## Consumption smoothing
3026

3127
Let
@@ -78,16 +74,16 @@ where $g_1 > 0, g_2 > 0$.
7874

7975
We shall see that when $\beta R = 1$ (a condition assumed by Milton Friedman and Robert Hall), this criterion assigns higher welfare to **smoother** consumption paths.
8076

81-
+++ {"user_expressions": []}
8277

83-
## Difference equations with linear algebra ##
78+
79+
## Difference equations with linear algebra
8480

8581
As a warmup, we'll describe a useful way of representing and "solving" linear difference equations.
8682

8783
To generate some $y$ vectors, we'll just write down a linear difference equation
8884
with appropriate initial conditions and then use linear algebra to solve it.
8985

90-
#### First-order difference equation
86+
### First-order difference equation
9187

9288
We'll start with a first-order linear difference equation for $\{y_t\}_{t=0}^T$:
9389

@@ -140,7 +136,7 @@ y_1 \cr y_2 \cr y_3 \cr \vdots \cr y_T
140136
$$
141137

142138

143-
#### Second order difference equation
139+
### Second order difference equation
144140

145141

146142
$$
@@ -162,12 +158,12 @@ $$
162158

163159
Multiplying both sides by inverse of the matrix on the left again provides the solution.
164160

165-
#### Extensions
161+
### Extensions
166162

167163
As an exercise, we ask you to represent and solve a **third order linear difference equation**.
168164
How many initial conditions must you specify?
169165

170-
+++ {"user_expressions": []}
166+
171167

172168
## Friedman-Hall consumption-smoothing model
173169

@@ -211,7 +207,6 @@ This is the consumption-smoothing model in a nutshell.
211207

212208
We'll put the model through some paces with Python code below.
213209

214-
+++ {"user_expressions": []}
215210

216211
## Permanent income model of consumption
217212

@@ -222,7 +217,7 @@ in Python, to solve the consumption smoothing model.
222217

223218
In the calculations below, please we'll set default values of $R > 1$, e.g., $R = 1.05$, and $\beta = R^{-1}$.
224219

225-
#### Step 1 ####
220+
### Step 1
226221

227222
For some $T+1 \times 1$ $y$ vector, use matrix algebra to compute
228223

@@ -231,7 +226,7 @@ $$
231226
\begin{bmatrix} y_0 \cr y_1 \cr \vdots \cr y_T \end{bmatrix}
232227
$$
233228

234-
#### Step 2 ####
229+
### Step 2
235230

236231
Compute
237232

@@ -241,7 +236,7 @@ $$
241236

242237
**Jiacheng:** The same for $R^t$ here.
243238

244-
#### Step 3 ####
239+
### Step 3
245240

246241
Formulate system
247242

@@ -276,9 +271,7 @@ $$
276271
Let's verify this with our Python code.
277272

278273

279-
280-
281-
### Feasible consumption variations ###
274+
### Feasible consumption variations
282275

283276
To explore what types of consumption paths are welfare-improving, we shall create an **admissible consumption path variation sequence** $\{v_t\}_{t=0}^T$
284277
that satisfies
@@ -395,7 +388,6 @@ class Consumption_smoothing:
395388
return cvar_seq
396389
```
397390

398-
+++ {"user_expressions": []}
399391

400392
Below is an example where the consumer inherits $a_0<0$ (which can be interpreted as a student debt).
401393

@@ -434,7 +426,7 @@ plt.ylabel(r'$c_t,y_t,a_t$')
434426
plt.show()
435427
```
436428

437-
+++ {"user_expressions": []}
429+
438430

439431
We can visualize how $\xi_1$ and $\phi$ controls **budget-feasible variations**.
440432

@@ -482,7 +474,3 @@ plt.ylabel('welfare')
482474
plt.xlabel(r'$\xi_1$')
483475
plt.show()
484476
```
485-
486-
```{code-cell} ipython3
487-
488-
```

0 commit comments

Comments
 (0)