@@ -654,7 +654,7 @@ The shocks $\{w_t\}$ were taken to be IID and standard normal.
654654```{code-cell} python3
655655# Model parameters
656656r = 0.05
657-β = 1/(1 + r)
657+β = 1 / (1 + r)
658658T = 45
659659c_bar = 2
660660σ = 0.25
@@ -693,14 +693,14 @@ bbox = (0., 1.02, 1., .102)
693693legend_args = {'bbox_to_anchor': bbox, 'loc': 3, 'mode': 'expand'}
694694p_args = {'lw': 2, 'alpha': 0.7}
695695696-axes[0].plot(list(range(1, T+1)), income, 'g-', label="non-financial income",
696+axes[0].plot(range(1, T+1), income, 'g-', label="non-financial income",
697697 **p_args)
698-axes[0].plot(list(range(T)), c, 'k-', label="consumption", **p_args)
698+axes[0].plot(range(T), c, 'k-', label="consumption", **p_args)
699699700-axes[1].plot(list(range(1, T+1)), np.cumsum(income - μ), 'r-',
700+axes[1].plot(range(1, T+1), np.cumsum(income - μ), 'r-',
701701 label="cumulative unanticipated income", **p_args)
702-axes[1].plot(list(range(T+1)), assets, 'b-', label="assets", **p_args)
703-axes[1].plot(list(range(T)), np.zeros(T), 'k-')
702+axes[1].plot(range(T+1), assets, 'b-', label="assets", **p_args)
703+axes[1].plot(range(T), np.zeros(T), 'k-')
704704705705for ax in axes:
706706 ax.grid()
@@ -761,14 +761,14 @@ bbox = (0., 1.02, 1., .102)
761761legend_args = {'bbox_to_anchor': bbox, 'loc': 3, 'mode': 'expand'}
762762p_args = {'lw': 2, 'alpha': 0.7}
763763764-axes[0].plot(list(range(1, T+1)), income, 'g-', label="non-financial income",
764+axes[0].plot(range(1, T+1), income, 'g-', label="non-financial income",
765765 **p_args)
766-axes[0].plot(list(range(T)), c, 'k-', label="consumption", **p_args)
766+axes[0].plot(range(T), c, 'k-', label="consumption", **p_args)
767767768-axes[1].plot(list(range(1, T+1)), np.cumsum(income - μ), 'r-',
768+axes[1].plot(range(1, T+1), np.cumsum(income - μ), 'r-',
769769 label="cumulative unanticipated income", **p_args)
770-axes[1].plot(list(range(T+1)), assets, 'b-', label="assets", **p_args)
771-axes[1].plot(list(range(T)), np.zeros(T), 'k-')
770+axes[1].plot(range(T+1), assets, 'b-', label="assets", **p_args)
771+axes[1].plot(range(T), np.zeros(T), 'k-')
772772773773for ax in axes:
774774 ax.grid()
@@ -1256,6 +1256,7 @@ The parameters are $r = 0.05, \beta = 1 / (1 + r), \bar c = 1.5, \mu = 2, \sigm
1256125612571257```{solution-start} lqc_ex1
12581258:class: dropdown
1259+:label: lqc_ex1_solution
12591260```
1260126112611262Here’s one solution.
@@ -1385,6 +1386,7 @@ together the simulations from these two separate models.
1385138613861387```{solution-start} lqc_ex2
13871388:class: dropdown
1389+:label: lqc_ex2_solution
13881390```
1389139113901392This is a permanent income / life-cycle model with polynomial growth in
@@ -1508,6 +1510,7 @@ For parameters, use $a_0 = 5, a_1 = 0.5, \sigma = 0.15, \rho = 0.9,
1508151015091511```{solution-start} lqc_ex3
15101512:class: dropdown
1513+:label: lqc_ex3_solution
15111514```
1512151515131516The first task is to find the matrices $A, B, C, Q, R$ that define