Skip to content

Commit 64c2ce1

Browse files
Fix graphs
1 parent 0c67fc4 commit 64c2ce1

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

lectures/input_output.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ from matplotlib.patches import Polygon
3434
```
3535

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

4040
```{code-cell} ipython3
@@ -88,6 +88,10 @@ tags: [hide-input]
8888
---
8989
centrality = qbn_io.eigenvector_centrality(A)
9090
91+
# Remove self-loops
92+
for i in range(A.shape[0]):
93+
A[i][i] = 0
94+
9195
fig, ax = plt.subplots(figsize=(8, 10))
9296
plt.axis("off")
9397
color_list = qbn_io.colorise_weights(centrality,beta=False)
@@ -237,11 +241,11 @@ More generally, constraints on production are
237241
$$
238242
\begin{aligned}
239243
(I - A) x & \geq d \cr
240-
a_0' x & \leq x_0
244+
a_0^\top x & \leq x_0
241245
\end{aligned}
242246
$$ (eq:inout_1)
243247
244-
where $A$ is the $n \times n$ matrix with typical element $a_{ij}$ and $a_0' = \begin{bmatrix} a_{01} & \cdots & a_{02} \end{bmatrix}$.
248+
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}$.
245249
246250
247251
@@ -322,19 +326,19 @@ x
322326
The second equation of {eq}`eq:inout_1` can be written
323327
324328
$$
325-
a_0' x = x_0
329+
a_0^\top x = x_0
326330
$$
327331
328332
or
329333
330334
$$
331-
A_0' d = x_0
335+
A_0^\top d = x_0
332336
$$ (eq:inout_frontier)
333337
334338
where
335339
336340
$$
337-
A_0' = a_0' (I - A)^{-1}
341+
A_0^\top = a_0^\top (I - A)^{-1}
338342
$$
339343
340344
For $i \in \{1, \ldots , n\}$, the $i$th component of $A_0$ is the amount of labor that is required to produce one unit of final output of good $i$.
@@ -346,12 +350,12 @@ Consider the example in {eq}`eq:inout_ex`.
346350
Suppose we are now given
347351
348352
$$
349-
a_0' = \begin{bmatrix}
353+
a_0^\top = \begin{bmatrix}
350354
4 & 100
351355
\end{bmatrix}
352356
$$
353357
354-
Then we can find $A_0'$ by
358+
Then we can find $A_0^\top$ by
355359
356360
```{code-cell} ipython3
357361
a0 = np.array([4, 100])
@@ -383,23 +387,23 @@ $$
383387
More generally,
384388
385389
$$
386-
p = A' p + a_0 w
390+
p = A^\top p + a_0 w
387391
$$
388392
389393
which states that the price of each final good equals the total cost
390-
of production, which consists of costs of intermediate inputs $A' p$
394+
of production, which consists of costs of intermediate inputs $A^\top p$
391395
plus costs of labor $a_0 w$.
392396
393397
This equation can be written as
394398
395399
$$
396-
(I - A') p = a_0 w
400+
(I - A^\top) p = a_0 w
397401
$$ (eq:inout_price)
398402
399403
which implies
400404
401405
$$
402-
p = (I - A')^{-1} a_0 w
406+
p = (I - A^\top)^{-1} a_0 w
403407
$$
404408
405409
Notice how {eq}`eq:inout_price` with {eq}`eq:inout_1` forms a
@@ -414,7 +418,7 @@ This connection surfaces again in a classic linear program and its dual.
414418
A **primal** problem is
415419
416420
$$
417-
\min_{x} w a_0' x
421+
\min_{x} w a_0^\top x
418422
$$
419423
420424
subject to
@@ -427,13 +431,13 @@ $$
427431
The associated **dual** problem is
428432
429433
$$
430-
\max_{p} p' d
434+
\max_{p} p^\top d
431435
$$
432436
433437
subject to
434438
435439
$$
436-
(I -A)' p \leq a_0 w
440+
(I -A)^\top p \leq a_0 w
437441
$$
438442
439443
The primal problem chooses a feasible production plan to minimize costs for delivering a pre-assigned vector of final goods consumption $d$.
@@ -444,7 +448,7 @@ By the [strong duality theorem](https://en.wikipedia.org/wiki/Dual_linear_progra
444448
optimal value of the primal and dual problems coincide:
445449
446450
$$
447-
w a_0' x^* = p^* d
451+
w a_0^\top x^* = p^* d
448452
$$
449453
450454
where $^*$'s denote optimal choices for the primal and dual problems.
@@ -569,12 +573,14 @@ $$
569573
\mu_j = \sum_{j=1}^n l_{ij}
570574
$$
571575
572-
This can be written as $\mu' = \mathbf{1}'L$ or
576+
This can be written as $\mu^\top = \mathbb{1}^\top L$ or
573577
574578
$$
575-
\mu' = \mathbf{1}' (I-A)^{-1}
579+
\mu^\top = \mathbb{1}^\top (I-A)^{-1}
576580
$$
577581
582+
Please note that here we use $\mathbb{1}$ to represent a vector of ones.
583+
578584
High ranking sectors within this measure are important buyers of intermediate goods.
579585
580586
A demand shock in such sectors will cause a large impact on the whole production network.

0 commit comments

Comments
 (0)