Skip to content

Commit

Permalink
Merge pull request #247 from QuantEcon/io_update
Browse files Browse the repository at this point in the history
Update input_output.md
  • Loading branch information
jstac committed Jun 22, 2023
2 parents ec9f5f1 + 0ce3152 commit 6e94242
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions lectures/input_output.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,22 @@ import numpy as np
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
```

The following figure illustrates a network of linkages among 15 sectors
obtained from the US Bureau of Economic Analysis’s 2021 Input-Output Accounts
Data.

```{code-cell} ipython3
:tags: [hide-cell]
import quantecon_book_networks
import quantecon_book_networks.input_output as qbn_io
import quantecon_book_networks.plotting as qbn_plt
import quantecon_book_networks.data as qbn_data
ch2_data = qbn_data.production()
import matplotlib as mpl
from matplotlib.patches import Polygon
quantecon_book_networks.config("matplotlib")
import matplotlib as mpl
mpl.rcParams.update(mpl.rcParamsDefault)
from matplotlib.patches import Polygon
```

The following figure illustrates a network of linkages among 15 sectors
obtained from the US Bureau of Economic Analysis’s 2021 Input-Output Accounts
Data.


```{code-cell} ipython3
:tags: [hide-cell]
Expand All @@ -73,6 +66,7 @@ def build_coefficient_matrices(Z, X):
return A, F
ch2_data = qbn_data.production()
codes = ch2_data["us_sectors_15"]["codes"]
Z = ch2_data["us_sectors_15"]["adjacency_matrix"]
X = ch2_data["us_sectors_15"]["total_industry_sales"]
Expand Down Expand Up @@ -246,7 +240,7 @@ a_0^\top x & \leq x_0
\end{aligned}
$$ (eq:inout_1)
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}$.
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}$.
Expand Down Expand Up @@ -305,13 +299,10 @@ Let's check the **Hawkins-Simon conditions**
np.linalg.det(B) > 0 # checking Hawkins-Simon conditions
```
Now, let's compute the **Leontieff inverse** matrix
Now, let's compute the **Leontief inverse** matrix
```{code-cell} ipython3
I = np.identity(2)
B = I - A
L = np.linalg.inv(B) # obtaining Leontieff inverse matrix
L = np.linalg.inv(B) # obtaining Leontief inverse matrix
L
```
Expand Down Expand Up @@ -651,7 +642,7 @@ where $z_0$ is a vector of labor services used in each industry.
```{solution-start} io_ex1
:class: dropdown
```
For each i = 0,1,2 and j = 1,2
For each $i = 0,1,2$ and $j = 1,2$
$$
a_{ij} = \frac{z_{ij}}{x_j}
Expand Down

0 comments on commit 6e94242

Please sign in to comment.