Skip to content

Commit 0e9d126

Browse files
Removed some verbose in one of the code cells
1 parent a812fb3 commit 0e9d126

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

lectures/lqcontrol.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ The shocks $\{w_t\}$ were taken to be IID and standard normal.
654654
```{code-cell} python3
655655
# Model parameters
656656
r = 0.05
657-
β = 1/(1 + r)
657+
β = 1 / (1 + r)
658658
T = 45
659659
c_bar = 2
660660
σ = 0.25
@@ -693,14 +693,14 @@ bbox = (0., 1.02, 1., .102)
693693
legend_args = {'bbox_to_anchor': bbox, 'loc': 3, 'mode': 'expand'}
694694
p_args = {'lw': 2, 'alpha': 0.7}
695695
696-
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)
699699
700-
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-')
704704
705705
for ax in axes:
706706
ax.grid()
@@ -761,14 +761,14 @@ bbox = (0., 1.02, 1., .102)
761761
legend_args = {'bbox_to_anchor': bbox, 'loc': 3, 'mode': 'expand'}
762762
p_args = {'lw': 2, 'alpha': 0.7}
763763
764-
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)
767767
768-
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-')
772772
773773
for 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
12561256

12571257
```{solution-start} lqc_ex1
12581258
:class: dropdown
1259+
:label: lqc_ex1_solution
12591260
```
12601261

12611262
Here’s one solution.
@@ -1385,6 +1386,7 @@ together the simulations from these two separate models.
13851386

13861387
```{solution-start} lqc_ex2
13871388
:class: dropdown
1389+
:label: lqc_ex2_solution
13881390
```
13891391

13901392
This 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,
15081510

15091511
```{solution-start} lqc_ex3
15101512
:class: dropdown
1513+
:label: lqc_ex3_solution
15111514
```
15121515

15131516
The first task is to find the matrices $A, B, C, Q, R$ that define

0 commit comments

Comments
 (0)