@@ -3,8 +3,10 @@ jupytext:
3
3
text_representation :
4
4
extension : .md
5
5
format_name : myst
6
+ format_version : 0.13
7
+ jupytext_version : 1.16.7
6
8
kernelspec :
7
- display_name : Python 3
9
+ display_name : Python 3 (ipykernel)
8
10
language : python
9
11
name : python3
10
12
---
@@ -25,10 +27,9 @@ kernelspec:
25
27
26
28
In addition to what's in Anaconda, this lecture will need the following libraries:
27
29
28
- ``` {code-cell} ipython
29
- ---
30
- tags: [hide-output]
31
- ---
30
+ ``` {code-cell} ipython3
31
+ :tags: [hide-output]
32
+
32
33
!pip install --upgrade quantecon
33
34
```
34
35
@@ -73,7 +74,7 @@ We cover only the key features of the problem in this lecture, leaving you to re
73
74
74
75
We'll need the following imports:
75
76
76
- ``` {code-cell} ipython
77
+ ``` {code-cell} ipython3
77
78
import sys
78
79
import numpy as np
79
80
import matplotlib.pyplot as plt
@@ -583,7 +584,7 @@ The following code provides functions for
583
584
584
585
Description and clarifications are given below
585
586
586
- ``` {code-cell} python3
587
+ ``` {code-cell} ipython3
587
588
# Set up a namedtuple to store data on the model economy
588
589
Economy = namedtuple('economy',
589
590
('β', # Discount factor
@@ -694,7 +695,7 @@ def compute_paths(T, econ):
694
695
a0 = 0.5 * (F @ (x_vals.T @ Sm.T)**2)[0]
695
696
H = ((Sb - Sd + Sg) @ x_vals) * ((Sg - Ss) @ x_vals)
696
697
b0 = 0.5 * (F @ H.T)[0]
697
- a0, b0 = float(a0), float(b0)
698
+ a0, b0 = float(a0[0] ), float(b0[0] )
698
699
else:
699
700
H = Sm.T @ Sm
700
701
a0 = 0.5 * var_quadratic_sum(A, C, H, β, x0)
@@ -889,7 +890,7 @@ with $\rho = 0.7$, $\mu_g = 0.35$ and $C_g = \mu_g \sqrt{1 - \rho^2} / 10$.
889
890
890
891
Here's the code
891
892
892
- ``` {code-cell} python3
893
+ ``` {code-cell} ipython3
893
894
# == Parameters == #
894
895
β = 1 / 1.05
895
896
ρ, mg = .7, .35
@@ -915,7 +916,7 @@ The legends on the figures indicate the variables being tracked.
915
916
Most obvious from the figure is tax smoothing in the sense that tax revenue is
916
917
much less variable than government expenditure.
917
918
918
- ``` {code-cell} python3
919
+ ``` {code-cell} ipython3
919
920
gen_fig_2(path)
920
921
```
921
922
@@ -931,7 +932,7 @@ See the original [manuscript](https://lectures.quantecon.org/_downloads/firenze.
931
932
932
933
Our second example adopts a discrete Markov specification for the exogenous process
933
934
934
- ``` {code-cell} python3
935
+ ``` {code-cell} ipython3
935
936
# == Parameters == #
936
937
β = 1 / 1.05
937
938
P = np.array([[0.8, 0.2, 0.0],
@@ -961,7 +962,7 @@ gen_fig_1(path)
961
962
962
963
The call ` gen_fig_2(path) ` generates
963
964
964
- ``` {code-cell} python3
965
+ ``` {code-cell} ipython3
965
966
gen_fig_2(path)
966
967
```
967
968
@@ -997,7 +998,7 @@ Produce the corresponding figures.
997
998
:class: dropdown
998
999
```
999
1000
1000
- ``` {code-cell} python3
1001
+ ``` {code-cell} ipython3
1001
1002
# == Parameters == #
1002
1003
β = 1 / 1.05
1003
1004
ρ, mg = .95, .35
@@ -1023,10 +1024,11 @@ path = compute_paths(T, economy)
1023
1024
gen_fig_1(path)
1024
1025
```
1025
1026
1026
- ``` {code-cell} python3
1027
+ ``` {code-cell} ipython3
1027
1028
gen_fig_2(path)
1028
1029
```
1029
1030
1030
1031
``` {solution-end}
1031
1032
```
1032
1033
1034
+
0 commit comments