You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lectures/match_transport.md
+38-21Lines changed: 38 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -17,30 +17,33 @@ kernelspec:
17
17
18
18
## Overview
19
19
20
-
Optimal transport theory is studies how one (marginal) probabilty measure can be related to another (marginal) probability measure in an ideal way.
20
+
Optimal transport theory studies how a marginal probabilty measure can be related to another marginal probability measure in an ideal way.
21
+
22
+
* here ideal means to minimize some cost criterion.
21
23
22
24
The output of such a theory is a **coupling** of the two probability measures, i.e., a joint probabilty
23
25
measure having those two marginal probability measures.
24
26
25
27
This lecture describes how Job Boerma, Aleh Tsyvinski, Ruodo Wang,
26
-
and Zhenyuan Zhang {cite}`boerma2023composite` used optimal transport theory to formulate and solve an equilibrium of a model in which wages and allocations of workers across jobs adjust to match measures of different types with measures of different types of occupations.
27
-
28
-
Production technologies allow firms to affect shape costs of mismatch with the consequence
29
-
that costs of mismatch can be concave.
28
+
and Zhenyuan Zhang {cite}`boerma2023composite` used optimal transport theory to formulate and compute an equilibrium of a model in which wages and allocations of workers across jobs adjust to match measures of different types with measures of different types of occupations.
30
29
31
-
That means that it is possible that equilibrium there is neither **positive assortive** nor **negative assorting** matching, an outcome that {cite}`boerma2023composite` call **composite assortive** matching.
30
+
Production technologies allow firms to reshape costs of mismatch so that they become concave.
32
31
33
-
For example, in an equilibrium with composite matching, identical *workers* can sort into different *occupations*, some positively and some negatively.
32
+
It is then possible that in equilibrium there is neither **positive assortive** nor **negative assorting** matching, an outcome that {cite}`boerma2023composite` call **composite assortive** matching.
34
33
35
-
{cite}`boerma2023composite` show how this can generate distinct distributions of labor earnings within and across occupations.
34
+
For example, with composite matching in an equilibrium model with workers of different types, ex ante identical *workers* can sort into different *occupations*, some positively and some negatively.
36
35
36
+
{cite}`boerma2023composite` show how composite matching can generate distinct non-trivial frequency distributions of labor earnings within and across occupations.
37
37
38
38
This lecture describes the {cite}`boerma2023composite` model and presents Python code for computing equilibria.
39
39
40
-
The lecture applies the code to the {cite}`boerma2023composite` model of labor markets.
40
+
The lecture then applies the code to the {cite}`boerma2023composite` model of labor markets.
41
41
42
42
As with an [earlier QuantEcon lecture on optimal transport](https://python.quantecon.org/opt_transport.html), a key tool will be [linear programming](https://intro.quantecon.org/lp_intro.html).
43
43
44
+
As we'll see, {cite}`boerma2023composite` also deploy dynamic programming in creative ways at important points in
45
+
their analysis. So as you read this lecture, please watch for Bellman equations that might remind
46
+
you of ideas encountered in this [earlier QuantEcon lecture](https://python.quantecon.org/mccall_model.html) and this [QuantEcon book](https://dp.quantecon.org).
44
47
45
48
46
49
## Setup
@@ -286,7 +289,7 @@ We now indicate important properties that are satisfied by an optimal solution.
286
289
287
290
+++ {"user_expressions": []}
288
291
289
-
**(Maximal number of perfect pairs)**
292
+
**Maximal number of perfect pairs**
290
293
291
294
If $(z,z) \in X \times Y$ for some $z \in \mathbb{R}$ then in each optimal solution there are $\min\{n_z,m_z\}$ matches between type $z \in X$ and $z \in Y$.
292
295
@@ -444,13 +447,21 @@ example_off_diag.plot_marginals(title='Distributions of types: off-diagonal')
444
447
445
448
+++ {"user_expressions": []}
446
449
447
-
**(No intersecting pairs)** This property summarizes the following fact:
450
+
To prepare the way for the second property, represent both types on the real line and draw semicirles that join $(x,y)$ for all pairs $(x,y) \in X \times Y$ that are matched in a solution.
451
+
452
+
In terms of these semicircles we assert the
453
+
448
454
449
-
* represent both types on the real line and draw a semicirle joining $(x,y)$ for all pairs $(x,y) \in X \times Y$ that are matched in a solution
450
455
451
-
* these semicirles do not intersect (unless they share one of the endpoints).
456
+
**No intersecting pairs property**
457
+
458
+
459
+
460
+
* unless they share one of the endpoints, the semicirles do not intersect.
452
461
453
-
A proof proceeds by contradiction.
462
+
463
+
464
+
To prove the property, we reason by contradiction.
454
465
455
466
Let's consider types $x,x' \in X$ and $y,y' \in Y.$
456
467
@@ -504,7 +515,11 @@ We conclude that if a matching features intersecting pairs, it can be modified v
504
515
505
516
+++ {"user_expressions": []}
506
517
507
-
**(Layering)** Recall that there are $2N$ individual agents, each agent $i$ having type $z_i \in X \sqcup Y.$
518
+
We now consider the third property.
519
+
520
+
**Layering**
521
+
522
+
Recall that there are $2N$ individual agents, each agent $i$ having type $z_i \in X \sqcup Y.$
508
523
509
524
When we introduce the off diagonal matching, to stress that the types sets are disjoint now.
510
525
@@ -668,7 +683,7 @@ print(layers_list_example)
668
683
669
684
+++ {"user_expressions": []}
670
685
671
-
The following method gives a graphical representation of the layers.
686
+
The following method provides a graphical representation of the layers.
672
687
673
688
From the picture it is easy to spot two key features described above:
674
689
@@ -799,15 +814,15 @@ Let $V_{ij}$ be the optimal value of matching agents in $[i,j]$ with $i,j \in [
799
814
800
815
Suppose that we computed the value $V_{ij}$ for all $i,j \in [N_\ell]$ with $i-j \in \{1,3,\dots,t-2\}$ for some odd natural number $t$.
801
816
802
-
Then, for $i,j \in [N_\ell]$ with $i-j= t$ we have
with the RHS depending only on previously computed values.
809
824
810
-
We set the boundary conditions at $t=-1$: $V_{i+1,i} = 0$ for each $i \in [N_\ell],$ so that we can apply the same Bellman equation at $t =1.$
825
+
We set the boundary conditions at $t=-1$: $V_{i+1,i} = 0$ for each $i \in [N_\ell],$ so that we can apply the same Bellman equation {eq}`eq:Bellman101` at $t =1.$
811
826
812
827
The following method takes as input the layer types indices and computes the value function as a matrix $[V_{ij}]_{ i \in [N_\ell+1], j \in [N_\ell ]}$.
Having computed the value function, we can proceed to compute the optimal matching as the *policy* that attains the value function that solves the Bellman equation (*policy evaluation*).
883
+
**Policy evaluation**
884
+
885
+
Having computed the value function, we can proceed to compute the optimal matching as the *policy* that attains the value function that solves the Bellman equation {eq}`eq:Bellman101`.
869
886
870
887
We start from agent $1$ and match it with the $k$ that achieves the minimum in the equation associated with $V_{1,2N_\ell}.$
871
888
@@ -1006,7 +1023,7 @@ Visually, the arc joining $(i',j')$ surmounts the arc joining $(i,j).$
1006
1023
1007
1024
As a consequence, there exists a more efficient way to compute the value function within a layer.
1008
1025
1009
-
It can be shown that the solving the following second-order difference equations delivers the same result as the Bellman equations above:
1026
+
It can be shown that the solving the following second-order difference equations delivers the same result as the Bellman equations {eq}`eq:Bellman101` presented above:
0 commit comments