@@ -30,29 +30,22 @@ import numpy as np
30
30
import pandas as pd
31
31
import networkx as nx
32
32
import matplotlib.pyplot as plt
33
- from matplotlib.patches import Polygon
34
- ```
35
-
36
- The following figure illustrates a network of linkages among 15 sectors
37
- obtained from the US Bureau of Economic Analysis’s 2021 Input-Output Accounts
38
- Data.
39
-
40
- ``` {code-cell} ipython3
41
- :tags: [hide-cell]
42
-
43
33
import quantecon_book_networks
44
34
import quantecon_book_networks.input_output as qbn_io
45
35
import quantecon_book_networks.plotting as qbn_plt
46
36
import quantecon_book_networks.data as qbn_data
47
-
48
- ch2_data = qbn_data.production()
37
+ import matplotlib as mpl
38
+ from matplotlib.patches import Polygon
49
39
50
40
quantecon_book_networks.config("matplotlib")
51
- import matplotlib as mpl
52
41
mpl.rcParams.update(mpl.rcParamsDefault)
53
- from matplotlib.patches import Polygon
54
42
```
55
43
44
+ The following figure illustrates a network of linkages among 15 sectors
45
+ obtained from the US Bureau of Economic Analysis’s 2021 Input-Output Accounts
46
+ Data.
47
+
48
+
56
49
``` {code-cell} ipython3
57
50
:tags: [hide-cell]
58
51
@@ -73,6 +66,7 @@ def build_coefficient_matrices(Z, X):
73
66
74
67
return A, F
75
68
69
+ ch2_data = qbn_data.production()
76
70
codes = ch2_data["us_sectors_15"]["codes"]
77
71
Z = ch2_data["us_sectors_15"]["adjacency_matrix"]
78
72
X = ch2_data["us_sectors_15"]["total_industry_sales"]
@@ -246,7 +240,7 @@ a_0^\top x & \leq x_0
246
240
\end{aligned}
247
241
$$ (eq:inout_1)
248
242
249
- where $A$ is the $n \times n$ matrix with typical element $a_{ij}$ and $a_0^\top = \begin{bmatrix} a_{01} & \cdots & a_{02 } \end{bmatrix}$.
243
+ where $A$ is the $n \times n$ matrix with typical element $a_{ij}$ and $a_0^\top = \begin{bmatrix} a_{01} & \cdots & a_{0n } \end{bmatrix}$.
250
244
251
245
252
246
@@ -305,13 +299,10 @@ Let's check the **Hawkins-Simon conditions**
305
299
np.linalg.det(B) > 0 # checking Hawkins-Simon conditions
306
300
```
307
301
308
- Now, let's compute the **Leontieff inverse** matrix
302
+ Now, let's compute the **Leontief inverse** matrix
309
303
310
304
```{code-cell} ipython3
311
- I = np.identity(2)
312
- B = I - A
313
-
314
- L = np.linalg.inv(B) # obtaining Leontieff inverse matrix
305
+ L = np.linalg.inv(B) # obtaining Leontief inverse matrix
315
306
L
316
307
```
317
308
@@ -651,7 +642,7 @@ where $z_0$ is a vector of labor services used in each industry.
651
642
```{solution-start} io_ex1
652
643
:class: dropdown
653
644
```
654
- For each i = 0,1,2 and j = 1,2
645
+ For each $ i = 0,1,2$ and $ j = 1,2$
655
646
656
647
$$
657
648
a_ {ij} = \frac{z_ {ij}}{x_j}
0 commit comments