@@ -51,14 +51,14 @@ A sequence of budget constraints constrains the triple of sequences $y, c, a$
51
51
52
52
$$
53
53
a_{t+1} = R (a_t+ y_t - c_t), \quad t =0, 1, \ldots T
54
- $$
54
+ $$ (eq:a_t)
55
55
56
56
Our model has the following logical flow
57
57
58
58
* start with an exogenous income sequence $y$, an initial financial wealth $a_0$, and
59
59
a candidate consumption path $c$.
60
60
61
- * use equation (1) to compute a path $a$ of financial wealth
61
+ * use equation {eq}`eq:a_t` to compute a path $a$ of financial wealth
62
62
63
63
* verify that $a_{T+1}$ satisfies the terminal wealth constraint $a_{T+1} \geq 0$.
64
64
@@ -160,7 +160,7 @@ y_1 \cr y_2 \cr y_3 \cr \vdots \cr y_T
160
160
```{exercise}
161
161
:label: consmooth_ex1
162
162
163
- In the {eq}`fst_ord_inverse`, we multiply the inverse of the matrix on the left ( $A$) . In this exercise, please confirm that
163
+ In the {eq}`fst_ord_inverse`, we multiply the inverse of the matrix $A$. In this exercise, please confirm that
164
164
165
165
$$
166
166
\begin{bmatrix}
@@ -222,7 +222,7 @@ h_0 \equiv \sum_{t=0}^T R^{-t} y_t = \begin{bmatrix} 1 & R^{-1} & \cdots & R^{-T
222
222
\begin{bmatrix} y_0 \cr y_1 \cr \vdots \cr y_T \end{bmatrix}
223
223
$$
224
224
225
- By iterating on equation (1) and imposing the terminal condition
225
+ By iterating on equation {eq}`eq:a_t` and imposing the terminal condition
226
226
227
227
$$
228
228
a_ {T+1} = 0,
251
251
252
252
This is the consumption-smoothing model in a nutshell.
253
253
254
- We implement this model in ` compute_optimal `
255
-
256
- ``` {code-cell} ipython3
257
- def compute_optimal(model, a0, y_seq):
258
- R, T = model.R, model.T
259
-
260
- # non-financial wealth
261
- h0 = model.β_seq @ y_seq # since β = 1/R
262
-
263
- # c0
264
- c0 = (1 - 1/R) / (1 - (1/R)**(T+1)) * (a0 + h0)
265
- c_seq = c0*np.ones(T+1)
266
-
267
- # verify
268
- A = np.diag(-R*np.ones(T), k=-1) + np.eye(T+1)
269
- b = y_seq - c_seq
270
- b[0] = b[0] + a0
271
-
272
- a_seq = np.linalg.inv(A) @ b
273
- a_seq = np.concatenate([[a0], a_seq])
274
-
275
- return c_seq, a_seq
276
- ```
277
-
278
254
+++ {"user_expressions": []}
279
255
280
256
## Permanent income model of consumption
@@ -286,7 +262,7 @@ In the calculations below, please we'll set default values of $R > 1$, e.g., $
286
262
287
263
### Step 1
288
264
289
- For some $(T+1) \times 1$ $y$ vector, use matrix algebra to compute
265
+ For some $(T+1) \times 1$ $y$ vector, use matrix algebra to compute $h_0$
290
266
291
267
$$
292
268
\sum_ {t=0}^T R^{-t} y_t = \begin{bmatrix} 1 & R^{-1} & \cdots & R^{-T} \end{bmatrix}
335
311
336
312
Let's verify this with our Python code.
337
313
314
+ First we implement this model in `compute_optimal`
315
+
316
+ ```{code-cell} ipython3
317
+ def compute_optimal(model, a0, y_seq):
318
+ R, T = model.R, model.T
319
+
320
+ # non-financial wealth
321
+ h0 = model.β_seq @ y_seq # since β = 1/R
322
+
323
+ # c0
324
+ c0 = (1 - 1/R) / (1 - (1/R)**(T+1)) * (a0 + h0)
325
+ c_seq = c0*np.ones(T+1)
326
+
327
+ # verify
328
+ A = np.diag(-R*np.ones(T), k=-1) + np.eye(T+1)
329
+ b = y_seq - c_seq
330
+ b[0] = b[0] + a0
331
+
332
+ a_seq = np.linalg.inv(A) @ b
333
+ a_seq = np.concatenate([[a0], a_seq])
334
+
335
+ return c_seq, a_seq
336
+ ```
337
+
338
338
We use an example where the consumer inherits $a_0<0$ (which can be interpreted as a student debt).
339
339
340
340
The income process $\{y_t\}_{t=0}^{T}$ is constant and positive up to $t=45$ and then becomes zero afterward.
@@ -353,6 +353,8 @@ print('check a_T+1=0:',
353
353
np.abs(a_seq[-1] - 0) <= 1e-8)
354
354
```
355
355
356
+ The visualization shows the path of income, consumption, and financial assets.
357
+
356
358
```{code-cell} ipython3
357
359
# Sequence Length
358
360
T = cs_model.T
@@ -368,9 +370,9 @@ plt.ylabel(r'$c_t,y_t,a_t$')
368
370
plt.show()
369
371
```
370
372
371
- +++ {"user_expressions": [ ] }
373
+ Note that $a_{T+1} = 0$ is satisfied.
372
374
373
- We can evaluate the welfare using the formula {eq}` welfare `
375
+ We can further evaluate the welfare using the formula {eq}`welfare`
374
376
375
377
```{code-cell} ipython3
376
378
def welfare(model, c_seq):
@@ -384,7 +386,7 @@ print('Welfare:', welfare(cs_model, c_seq))
384
386
385
387
+++ {"user_expressions": []}
386
388
387
- ### Feasible consumption variations ###
389
+ ### Feasible consumption variations
388
390
389
391
To explore what types of consumption paths are welfare-improving, we shall create an **admissible consumption path variation sequence** $\{v_t\}_{t=0}^T$
390
392
that satisfies
0 commit comments