Skip to content

Commit 0ce3152

Browse files
committed
Update input_output.md
1 parent ec9f5f1 commit 0ce3152

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

lectures/input_output.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,22 @@ import numpy as np
3030
import pandas as pd
3131
import networkx as nx
3232
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-
4333
import quantecon_book_networks
4434
import quantecon_book_networks.input_output as qbn_io
4535
import quantecon_book_networks.plotting as qbn_plt
4636
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
4939
5040
quantecon_book_networks.config("matplotlib")
51-
import matplotlib as mpl
5241
mpl.rcParams.update(mpl.rcParamsDefault)
53-
from matplotlib.patches import Polygon
5442
```
5543

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+
5649
```{code-cell} ipython3
5750
:tags: [hide-cell]
5851
@@ -73,6 +66,7 @@ def build_coefficient_matrices(Z, X):
7366
7467
return A, F
7568
69+
ch2_data = qbn_data.production()
7670
codes = ch2_data["us_sectors_15"]["codes"]
7771
Z = ch2_data["us_sectors_15"]["adjacency_matrix"]
7872
X = ch2_data["us_sectors_15"]["total_industry_sales"]
@@ -246,7 +240,7 @@ a_0^\top x & \leq x_0
246240
\end{aligned}
247241
$$ (eq:inout_1)
248242
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}$.
250244
251245
252246
@@ -305,13 +299,10 @@ Let's check the **Hawkins-Simon conditions**
305299
np.linalg.det(B) > 0 # checking Hawkins-Simon conditions
306300
```
307301
308-
Now, let's compute the **Leontieff inverse** matrix
302+
Now, let's compute the **Leontief inverse** matrix
309303
310304
```{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
315306
L
316307
```
317308
@@ -651,7 +642,7 @@ where $z_0$ is a vector of labor services used in each industry.
651642
```{solution-start} io_ex1
652643
:class: dropdown
653644
```
654-
For each i = 0,1,2 and j = 1,2
645+
For each $i = 0,1,2$ and $j = 1,2$
655646
656647
$$
657648
a_{ij} = \frac{z_{ij}}{x_j}

0 commit comments

Comments
 (0)