@@ -30,10 +30,11 @@ 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
33
34
```
34
35
35
36
The following figure illustrates a network of linkages among 15 sectors
36
- 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
37
38
Data.
38
39
39
40
``` {code-cell} ipython3
@@ -88,6 +89,10 @@ tags: [hide-input]
88
89
---
89
90
centrality = qbn_io.eigenvector_centrality(A)
90
91
92
+ # Remove self-loops
93
+ for i in range(A.shape[0]):
94
+ A[i][i] = 0
95
+
91
96
fig, ax = plt.subplots(figsize=(8, 10))
92
97
plt.axis("off")
93
98
color_list = qbn_io.colorise_weights(centrality,beta=False)
@@ -237,11 +242,11 @@ More generally, constraints on production are
237
242
$$
238
243
\begin{aligned}
239
244
(I - A) x & \geq d \cr
240
- a_0' x & \leq x_0
245
+ a_0^\top x & \leq x_0
241
246
\end{aligned}
242
247
$$ (eq:inout_1)
243
248
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}$.
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}$.
245
250
246
251
247
252
322
327
The second equation of {eq}`eq:inout_1` can be written
323
328
324
329
$$
325
- a_0' x = x_0
330
+ a_0^\top x = x_0
326
331
$$
327
332
328
333
or
329
334
330
335
$$
331
- A_0' d = x_0
336
+ A_0^\top d = x_0
332
337
$$ (eq:inout_frontier)
333
338
334
339
where
335
340
336
341
$$
337
- A_0' = a_0' (I - A)^{-1}
342
+ A_0^\top = a_0^\top (I - A)^{-1}
338
343
$$
339
344
340
345
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 +351,12 @@ Consider the example in {eq}`eq:inout_ex`.
346
351
Suppose we are now given
347
352
348
353
$$
349
- a_0' = \begin{bmatrix}
354
+ a_0^\top = \begin{bmatrix}
350
355
4 & 100
351
356
\end{bmatrix}
352
357
$$
353
358
354
- Then we can find $A_0' $ by
359
+ Then we can find $A_0^\top $ by
355
360
356
361
```{code-cell} ipython3
357
362
a0 = np.array([4, 100])
383
388
More generally,
384
389
385
390
$$
386
- p = A' p + a_0 w
391
+ p = A^\top p + a_0 w
387
392
$$
388
393
389
394
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$
395
+ of production, which consists of costs of intermediate inputs $A^\top p$
391
396
plus costs of labor $a_0 w$.
392
397
393
398
This equation can be written as
394
399
395
400
$$
396
- (I - A' ) p = a_0 w
401
+ (I - A^\top ) p = a_0 w
397
402
$$ (eq:inout_price)
398
403
399
404
which implies
400
405
401
406
$$
402
- p = (I - A' )^{-1} a_0 w
407
+ p = (I - A^\top )^{-1} a_0 w
403
408
$$
404
409
405
410
Notice how {eq}`eq:inout_price` with {eq}`eq:inout_1` forms a
@@ -414,7 +419,7 @@ This connection surfaces again in a classic linear program and its dual.
414
419
A **primal** problem is
415
420
416
421
$$
417
- \min_ {x} w a_0' x
422
+ \min_ {x} w a_0^\top x
418
423
$$
419
424
420
425
subject to
427
432
The associated **dual** problem is
428
433
429
434
$$
430
- \max_ {p} p' d
435
+ \max_ {p} p^\top d
431
436
$$
432
437
433
438
subject to
434
439
435
440
$$
436
- (I -A)' p \leq a_0 w
441
+ (I -A)^\top p \leq a_0 w
437
442
$$
438
443
439
444
The primal problem chooses a feasible production plan to minimize costs for delivering a pre-assigned vector of final goods consumption $d$.
@@ -444,7 +449,7 @@ By the [strong duality theorem](https://en.wikipedia.org/wiki/Dual_linear_progra
444
449
optimal value of the primal and dual problems coincide:
445
450
446
451
$$
447
- w a_0' x^* = p^* d
452
+ w a_0^\top x^* = p^* d
448
453
$$
449
454
450
455
where $^*$'s denote optimal choices for the primal and dual problems.
569
574
\mu_j = \sum_ {j=1}^n l_ {ij}
570
575
$$
571
576
572
- This can be written as $\mu' = \mathbf{1}'L$ or
577
+ This can be written as $\mu^\top = \mathbb{1}^\top L$ or
578
+
573
579
574
580
$$
575
- \mu' = \mathbf {1}' (I-A)^{-1}
581
+ \mu^\top = \mathbb {1}^\top (I-A)^{-1}
576
582
$$
577
583
584
+ Please note that here we use $\mathbb{1}$ to represent a vector of ones.
585
+
578
586
High ranking sectors within this measure are important buyers of intermediate goods.
579
587
580
588
A demand shock in such sectors will cause a large impact on the whole production network.
0 commit comments