@@ -11,7 +11,6 @@ kernelspec:
1111 name : python3
1212---
1313
14- +++ {"user_expressions": [ ] }
1514
1615# Input-Output Models
1716
@@ -20,9 +19,8 @@ kernelspec:
2019This lecture requires the following imports and installs before we proceed.
2120
2221``` {code-cell} ipython3
23- ---
24- tags: [hide-output]
25- ---
22+ :tags: [hide-output]
23+
2624!pip install quantecon_book_networks
2725!pip install quantecon
2826```
@@ -34,15 +32,14 @@ import networkx as nx
3432import matplotlib.pyplot as plt
3533```
3634
37- +++ {"user_expressions": [ ] }
3835
39- The following figure illustrates a network of linkages between 15 sectors obtained from the US Bureau of Economic Analysis’s
40- 2019 Input-Output Accounts Data.
36+ The following figure illustrates a network of linkages between 15 sectors
37+ obtained from the US Bureau of Economic Analysis’s 2019 Input-Output Accounts
38+ Data.
4139
4240``` {code-cell} ipython3
43- ---
44- tags: [hide-cell]
45- ---
41+ :tags: [hide-cell]
42+
4643import quantecon as qe
4744import quantecon_book_networks
4845import quantecon_book_networks.input_output as qbn_io
@@ -58,9 +55,8 @@ mpl.rcParams.update(mpl.rcParamsDefault)
5855```
5956
6057``` {code-cell} ipython3
61- ---
62- tags: [hide-cell]
63- ---
58+ :tags: [hide-cell]
59+
6460def build_coefficient_matrices(Z, X):
6561 """
6662 Build coefficient matrices A and F from Z and X via
@@ -88,9 +84,9 @@ A, F = build_coefficient_matrices(Z, X)
8884---
8985mystnb:
9086 figure:
91- caption: "US 15 Sector Production Network "
87+ caption: "US 15 sector production network "
9288 name: us_15sectors
93- tags: [hide-input ]
89+ : tags: [hide-cell ]
9490---
9591centrality = qbn_io.eigenvector_centrality(A)
9692
@@ -107,7 +103,6 @@ qbn_plt.plot_graph(A, X, ax, codes,
107103plt.show()
108104```
109105
110- +++ {"user_expressions": [ ] }
111106
112107| Label| Sector | Label| Sector | Label| Sector |
113108| :---:| :-------------:| :---:| :--------------:| :---:| :-------------------------:|
@@ -117,19 +112,22 @@ plt.show()
117112| co | Construction | in | Information | ot | Other Services (exc govt) |
118113| ma | Manufacturing | fi | Finance | go | Government |
119114
120- +++ {"user_expressions": [ ] }
121115
122- An arrow from $i$ to $j$ implies that sector $i$ supplies some of its output as raw material to sector $j$.
116+ An arrow from $i$ to $j$ implies that sector $i$ supplies some of its output as
117+ raw material to sector $j$.
123118
124- Economies are characterised by many such complex and interdependent multisector production networks.
119+ Economies are characterised by many such complex and interdependent multisector
120+ production networks.
125121
126- A basic framework for their analysis is [ Leontief's] ( https://en.wikipedia.org/wiki/Wassily_Leontief ) input-output model.
122+ A basic framework for their analysis is
123+ [ Leontief's] ( https://en.wikipedia.org/wiki/Wassily_Leontief ) input-output model.
127124
128125This model's key aspect is its simplicity.
129126
130- In this lecture, we first introduce the standard input-ouput model and approach it as a [ linear programming] (link to lpp lecture) problem.
127+ In this lecture, we first introduce the standard input-ouput model and approach it as a linear programming problem.
128+
129+ (TODO add link to lpp lecture)
131130
132- +++ {"user_expressions": [ ] }
133131
134132## Input Output Analysis
135133
149147The production function for goods $j \in \{ 1, \ldots , n\} $ is the ** Leontief** function
150148
151149$$
152- x_j = \min_{i \in \{0, \ldots , n \}} \left( \frac{z_{ij}}{a_{ij}}\right)
150+ x_j = \min_{i \in \{0, \ldots , n \}} \left( \frac{z_{ij}}{a_{ij}}\right)
153151$$
154152
155153### Two Goods
@@ -160,7 +158,7 @@ The following is a simple illustration of this network.
160158
161159``` {code-cell} ipython3
162160---
163- tags: [hide-input ]
161+ : tags: [hide-cell ]
164162---
165163G = nx.DiGraph()
166164
@@ -192,8 +190,6 @@ plt.text(1.6,-0.5, r'$d_{2}$')
192190plt.show()
193191```
194192
195- +++ {"user_expressions": [ ] }
196-
197193** Feasible allocations must satisfy**
198194
199195$$
@@ -208,7 +204,7 @@ This can be graphically represented as follows.
208204
209205``` {code-cell} ipython3
210206---
211- tags: [hide-input ]
207+ : tags: [hide-cell ]
212208---
213209from matplotlib.patches import Polygon
214210
@@ -455,7 +451,7 @@ The dual problem can be graphically represented as follows.
455451
456452```{code-cell} ipython3
457453---
458- tags: [hide-input ]
454+ : tags: [hide-cell ]
459455---
460456from matplotlib.patches import Polygon
461457
522518E = \{ (i,j) \in V \times V : a_ {ij}>0\}
523519$$
524520
525- In {numref}`us_15sectors` weights are indicated by the widths of the arrows, which are proportional to the corresponding
526- input-output coefficients.
521+ In {numref}`us_15sectors` weights are indicated by the widths of the arrows, which are proportional to the corresponding input-output coefficients.
527522
528523We can now use centrality measures to rank sectors and discuss their importance relative to the other sectors.
529524
539534We plot a bar graph of hub-based eigenvector centrality for the sectors represented in {numref}`us_15sectors`.
540535
541536```{code-cell} ipython3
542- tags: [hide-input ]
537+ : tags: [hide-cell ]
543538
544539fig, ax = plt.subplots()
545540ax.bar(codes, centrality, color=color_list, alpha=0.6)
546541ax.set_ylabel("eigenvector centrality", fontsize=12)
547542plt.show()
548543```
549544
550- +++ {"user_expressions": []}
551545
552546A higher measure indicates higher importance as a supplier.
553547
@@ -579,10 +573,11 @@ High ranking sectors within this measure are important buyers of intermediate go
579573
580574A demand shock in such sectors will cause a large impact on the whole production network.
581575
582- The following figure displays the output multipliers for the sectors represented in {numref}`us_15sectors`.
576+ The following figure displays the output multipliers for the sectors represented
577+ in {numref}`us_15sectors`.
583578
584579```{code-cell} ipython3
585- tags: [hide-input ]
580+ : tags: [hide-cell ]
586581
587582omult = qbn_io.katz_centrality(A, authority=True)
588583
@@ -593,19 +588,17 @@ ax.set_ylabel("Output multipliers", fontsize=12)
593588plt.show()
594589```
595590
596- +++ {"user_expressions": []}
597591
598592We observe that manufacturing and agriculture are highest ranking sectors.
599593
600- +++ {"user_expressions": []}
601594
602595## Exercises
603596
604597```{exercise-start}
605598:label: io_ex1
606599```
607600
608- {cite}DoSSo Chapter 9 carries along an example with the following
601+ {cite}` DoSSo` Chapter 9 discusses an example with the following
609602parameter settings:
610603
611604$$
0 commit comments