Skip to content

Commit 4f7c1c1

Browse files
Tom's Feb 12 edits of consumption smoothing lecture
1 parent ee9cce3 commit 4f7c1c1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lectures/cons_smooth.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,16 +385,14 @@ We'll make $W_0$ big - positive to indicate a one-time windfall, and negative to
385385
386386
```{code-cell} ipython3
387387
# Windfall W_0 = 2.5
388-
y_seq_pos = np.concatenate(
389-
[np.ones(21), np.array([2.5]), np.ones(44)])
388+
y_seq_pos = np.concatenate([np.ones(21), np.array([2.5]), np.ones(24), np.zeros(20)])
390389
391390
plot_cs(cs_model, a0, y_seq_pos)
392391
```
393392
394393
```{code-cell} ipython3
395394
# Disaster W_0 = -2.5
396-
y_seq_neg = np.concatenate(
397-
[np.ones(21), np.array([-2.5]), np.ones(44)])
395+
y_seq_neg = np.concatenate([np.ones(21), np.array([-2.5]), np.ones(24), np.zeros(20)])
398396
399397
plot_cs(cs_model, a0, y_seq_neg)
400398
```
@@ -408,15 +406,15 @@ Again we can study positive and negative cases
408406
```{code-cell} ipython3
409407
# Positive permanent income change W = 0.5 when t >= 21
410408
y_seq_pos = np.concatenate(
411-
[np.ones(21), np.repeat(1.5, 45)])
409+
[np.ones(21), 1.5*np.ones(25), np.zeros(20)])
412410
413411
plot_cs(cs_model, a0, y_seq_pos)
414412
```
415413
416414
```{code-cell} ipython3
417415
# Negative permanent income change W = -0.5 when t >= 21
418416
y_seq_neg = np.concatenate(
419-
[np.ones(21), np.repeat(0.5, 45)])
417+
[np.ones(21), .5*np.ones(25), np.zeros(20)])
420418
421419
plot_cs(cs_model, a0, y_seq_neg)
422420
```

0 commit comments

Comments
 (0)