4/18/2018
1
Matching
Matching markets• In many markets, you care who you are dealing with, and prices don’t do all the work of matching
• (In some matching markets, we don’t even let prices do any of the work…)
4/18/2018
2
3
Cornell doesn’t raise tuition until just enough applicants remain to fill its seats
You can’t just show up for work at Google: you have to be hired
Matching markets are markets in which you can’t just choose what you want (even if you can afford it)—you also have to be chosen
What do online marketplaces do? Airbnb, for example• Thickness
• Initially, Airbnb bought competitive rival web sites to get hosts and travellers (e.g. Crashpadder in England)
• Now competitors are hotels
• Friction/Congestion• Think of how much less convenient a hotel would be if you could only inquire about one room at a time…
• Instant book (new design element with multiple effects)
• Trust and Safety
4
Many markets fall in between pure commodity (where only price/money matters) markets and pure matching markets. Airbnb host can choose not to have some people. Technology facilitates new types of markets.
4/18/2018
3
MatchmakingNewer dating appsNew markets for traditional
matchmaking
The Relationship App
The woman makes the first move, 24 hour window
Swipe left or right
Other kinds of matchmaking
4/18/2018
4
7
Matching Markets with no money
• Medical labor markets • Medical Residents in the U.S.: National Resident Matching Program (NRMP)
• Medical residents in Canada (CaRMS)• Medical fellowships
• Teacher assignment—Teach for America
• School choice systems: (no money changes hands, but preferences are important…)
• Kidney exchange
Two‐sided matching markets
4/18/2018
5
The Matching Problem
`Reward’ Rij
The Matching Problem: How would you match?
`Reward’ Rij
4/18/2018
6
Matching residents to Internships
1
2
A
B
C
12
21
12
ABC
CAB1: A B
2: C
Matching Algorithm
The Match
• The Match is a program administered by the National Resident Matching Program (NRMP).
1
2
A
B
C
12
21
12
ABC
CAB1: A B
2: C
4/18/2018
7
Match Day – 3rd Thursday in March
13
The Stable Marriage problem• Each program/firm has a preference list over workers/doctors (may not list everyone)
• Each worker has a preference list over firms (may not list everyone).
A matching assigns each worker to at most one firm and vice versa (this can be extended to so that the firm has multiple positions)
It is stable if no pair of a firm and worker prefer both to “drop” their assignments and match to each other.
Question: Is there a stable matching?
How can we find one?
4/18/2018
8
Matching definitios
A matching is individually rational if no agent is matched to an unacceptable mate.
A matching is blocked by a pair of agents (m,w) if they each prefer each other to , i.e. and
A matching is stable if it individually rational and is not blocked by any pair of agents.
Gale‐Shapley (1962) Deferred Acceptance Algorithm, with workers applying
• 1 a. Each worker applies to his/her top choice firm.
• b. Each firm f with q positions holds the top q applications among the acceptable applications it receives, and rejects all others.
• k a. Any worker rejected at step k‐1 makes a new application, to its most preferred acceptable firm that hasn’t yet rejected him/her. (If no acceptable choices remain, he/she makes no further offers.)
• b. Each firm holds its q most preferred acceptable applications to date, and rejects the rest.
• STOP: when no further proposals are made, and match each firm to the workers (if any) whose applications it is holding.
4/18/2018
9
The preferences of 3 doctors and 4 programs:
Example
A B C
1 2 4
2 4 1
3 3 2
4 1 3
1 2 3 4
A C A B
B A C C
C B B A
Example
A B C
1 2 4
2 4 1
3 3 2
4 1 3
1 2 3 4
A C A B
B A C C
C B B A
A non stable matching. A and 2 would block because Doctor A prefers 2 over 3 and hospital 2 prefers A over B.
4/18/2018
10
Stable match 1:
(3 is unmatched)
Example
A B C
1 2 4
2 4 1
3 3 2
4 1 3
1 2 3 4
A C A B
B A C C
C B B A
Stable match 2:
(3 is unmatched)
Example
A B C
1 2 4
2 4 1
3 3 2
4 1 3
1 2 3 4
A C A B
B A C C
C B B A
4/18/2018
11
The Deferred Acceptance Algorithm –ExampleStudents/doctors S1,S2,S3 and Programs are P1,P2,P3
Preferences:
S1: P1,P2 P1:S3,S2,S1
S2: P1,P3 P2:S1,S3
S3: P2,P1 P3:S2,S1
(1) Find the stable matching resulting from the deferred acceptance algorithm
(2) Let’s get back to the previous example:(a) Resident propose(b) Program proposes(c) 2 and 1 swap places in A’s preferences
Existence of stability
Does a stable matching always exists?
Theorem (Gale and Shapley): The DA produces a stable matching.
Proof:
• The algorithm terminates (Why?). When it terminates it produces a matching.
• The matching is individually rational (no man makes an offer to an unacceptable woman and women reject unacceptable offers).
• Suppose , blocks. This means that made offer to , and rejected in favor of a better match – a contradiction.
For example: Suppose Alice got her 3rd choice. Would her 1st or 2nd choices be willing to drop their assignments and hire her? No, since when Alice “applied” for these choices, she was rejected since they had an offer from a student they preferred. Furthermore, the programs’ matches can only improve through out the algorithm
Questions: how many stable matchings are there? We saw that there can be multiple stable outcomes…
4/18/2018
12
Remarkable Theorems
• Theorem 1: A stable matching exists for every marriage market. (but there could be many)
• Theorem 2: When all firms and workers have strict preferences, the Worker‐applying deferred acceptance algorithm produces the W‐optimal stable matching W (that every worker likes at least as well as any other stable matching).(The Firm optimal stable matching results when the firms make offers).
• Theorem 3 (GS): The best “strategy” for each worker is to report his/her true preference list (regardless of what anyone else is reporting).
24
Clearinghouses that find stable matchings
Medical Residencies in the U.S. (NRMP) (1952)
Abdominal Transplant Surgery (2005)
Child & Adolescent Psychiatry (1995)
Colon & Rectal Surgery (1984)
Combined Musculoskeletal Matching Program (CMMP)
Hand Surgery (1990)
Medical Specialties Matching Program (MSMP)
Cardiovascular Disease (1986)
Gastroenterology (1986‐1999; rejoined in 2006)
Hematology (2006)
Hematology/Oncology (2006)
Infectious Disease (1986‐1990; rejoined in 1994)
Oncology (2006)
Pulmonary and Critical Medicine (1986)
Rheumatology (2005)
Minimally Invasive and Gastrointestinal Surgery (2003)
Obstetrics/Gynecology
Reproductive Endocrinology (1991)
Gynecologic Oncology (1993)
Maternal‐Fetal Medicine (1994)
Female Pelvic Medicine & Reconstructive Surgery (2001)
Ophthalmic Plastic & Reconstructive Surgery (1991)
Pediatric Cardiology (1999)
Pediatric Critical Care Medicine (2000)
Pediatric Emergency Medicine (1994)
Pediatric Hematology/Oncology (2001)
Pediatric Rheumatology (2004)
Pediatric Surgery (1992)
Primary Care Sports Medicine (1994)
Radiology
Interventional Radiology (2002)
Neuroradiology (2001)
Pediatric Radiology (2003)
Surgical Critical Care (2004)
Thoracic Surgery (1988)
Vascular Surgery (1988)
Postdoctoral Dental Residencies in the United States
Oral and Maxillofacial Surgery (1985)
General Practice Residency (1986)
Advanced Education in General Dentistry (1986)
Pediatric Dentistry (1989)
Orthodontics (1996)
Psychology Internships (1999)
Neuropsychology Residencies in the U.S. & CA (2001)
Osteopathic Internships in the U.S. (before 1995)
Pharmacy Practice Residencies in the U.S. (1994)
Articling Positions with Law Firms in Alberta, CA(1993)
Medical Residencies in CA (CaRMS) (before 1970)
British (medical) house officer positions
Edinburgh (1969)
Cardiff (197x)
New York City High Schools (2003)
Boston Public Schools (2006), Denver, New Orleans
4/18/2018
13
Market Stable Still in use (halted unraveling)
• NRMP yes yes (new design in ’98)
• Edinburgh ('69) yes yes
• Cardiff yes yes
• Birmingham no no
• Edinburgh ('67) no no
• Newcastle no no
• Sheffield no no
• Cambridge no yes
• London Hospital no yes
• Medical Specialties yes yes
• Canadian Lawyers yes yes
• Dental Residencies yes yes (5 ) (no 2)
• Osteopaths (< '94) no no
• Osteopaths (> '94) yes yes
• Pharmacists yes yes
• Reform rabbis yes (first used in ‘97‐98) yes
• Clinical psych yes (first used in ‘99) yes
Stability is an important robustness feature: Clearing houses are sustainable when they produce stable matchings
Does it matter who makes the first move (applicants or programs) and how much?
1987 1993 1994 1995 1996
APPLICANTS
Number of Applicants Affected
20 16 20 14 21
Applicant Proposing Result Preferred
12 16 11 14 12
Program Proposing Result Preferred
8 0 9 0 9
PROGRAMS
Number of Programs Affected
20 15 23 15 19
Applicant Proposing Result Preferred
8 0 12 1 10
Program Proposing Result Preferred
12 15 11 14 9
4/18/2018
14
The larger the market the more the order (may) matter
Simulation results on randomly generated data
Simple model: n firms, n workers, (no couples) and drawn independently and uniformly.
applies to k hospitals.
= number of doctors matched differently under MOSM and WOSM
Large core with , / is the proportion of workers who receive different matches at different stable matchings, in a simple market (no couples) with n workers and n firms (each of which employs one worker) when preferences are uncorrelated and each preference list consists of all n agents on the other side of the market. (from Roth and Peranson, 1999) Note that as the market grows large in this way, so does the set of stable matchings, in the sense that for large markets, almost every worker is effected by the choice of stable matching.
Small core of large markets, with k fixed as n grows: C(n)/n is the proportion of workers who receive different matches at different stable matchings, in a simple market with n workers and n firms, when each worker applies to k firms, each firm ranks all workers who apply, and preferences are uncorrelated. (from Roth and Peranson, 1999). Note that for any fixed k, the set of stable matchings grows small as n grows large.
28
With small (incomplete) preference lists, the order will matter less because there are fewer stable matchings
4/18/2018
15
Large core in balanced random markets
Theorem [Pittel 1998, Knuth, Motwani, Pittel 1990]: In a random market with men and women, with high probability:
1. The core is large: the fraction of agents that have multiple stable partners tends to 1 as tends to infinity.
2. The average ranks in the WOSM are
logand
log
=1000, log = 6.9, /log =145=100000, log =11.5, /log =8695
If there are fewer men than woman, men do (much) better). Competition has a sharp effect
0
2
4
6
8
10
12
14
16
18
20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60
Men
's av
erag
e ra
nk o
f wiv
es
Number of men
MOSMWOSM
There are 40 women in this market
4/18/2018
16
School Choice and Assignment(an example of market engineering: How to
choose the best stable matching)
Assignment algorithm in Boston prior to 2006• Students have priorities at schools set by central school system
• Students entering grades K, 6, and 9 submit (strict) preferences over schools.
• In priority order, everyone who can be assigned to his first choice is. Then 2nd choices, etc.
• Priorities: sibling, walk zone, random tie‐breaker• There are lots of people in each priority class (non‐strict preferences)
Remark: First choices are very important. If you don’t get your first choice, you might drop far down list (and your priority status may be lost: all 2nd choices are lower priority than all 1st...). Could you (as a student) gain by reporting false preferences?
4/18/2018
17
Recommendations for Boston Public Schools• Switch to a strategy‐proof mechanism.
• Student Proposing Deferred Acceptance Algorithm (as in NYC)
• Would produce “stable” assignments—no student is not assigned to a school he/she prefers unless that school is full to capacity with higher priority students
Gale‐Shapley’s Deferred Acceptance (DA) Algorithm (since 06):
1. Student applies to top choice in menu.2. School tentatively accepts if space available; otherwise reject out least priority student.3. Remove choice from rejected student; iterate.
Boston School Assignment after the change in 2006~ 4000 students/year
77 elementary schools
Families rank any number of schools within choice menu: their zone + one‐mile walk zone
Priorities:walk‐zone (50% of seats);Random number
4/18/2018
18
• Stable: no student who loses a seat to a lower priority student and receives a less‐preferred assignment
• Incentives: makes truthful representation a dominant strategy for each student
• Efficiency: selects the stable matching that is preferred to any other stable matching by all students—no “justified envy” (when preferences are strict)
Student‐Proposing Deferred Acceptance
Framework for School Choice
Menus Priorities
Choices
Assignment Algorithm
Home Location
School Assignment
Implemented in Boston, New Orleans, San Francisco, NYC, Chicago
4/18/2018
19
• How to break ties? (schools do not always have strict preferences over students)
• How to design menus?
Design questions
Tie‐breakings (very briefly)
• Two common tie‐breakings rules are: • Single Tiebreaking rule (STB) ‐ all schools use the same random order over students
• Multiple (separate) Tiebreaking rule (MTB) – every school will use a separate random order to break ties
• STB and MTB do not harm students’ incentives• Intuitively because they do not depend on students’ preferences
4/18/2018
20
Differences between STB and MTB
• Why MTB?• “It is more fair” [Amsterdam; http://www.kennislink.nl/]
• Email about this: : “I believe that the equitable approach is for a child to have a new chance... This might result in both students getting their second choices, the fact is that each child had a chance. If we use only one random number, and I had the bad luck to be the last student in line this would be repeated 12 times and I never get a chance. I do not know how we could explain that to a student and parent.”
• Why STB?• “Using [STB] might be a better idea [...] since this practice eliminates part of the inefficiency”
To choose one can simulate and see which one does better in, for example, providing the most people their first preference.
• How to break ties? (schools do not always have strict preferences over students)
• How to design menus?
Remark: Notice that, in this context, the preferences of schools over students (which are an inputs to deferred acceptance) are a design choice
Design questions
4/18/2018
21
Example: Boston School Assignment
~ 4000 K2 students/year
77 elementary schools
Families rank any number of schools within choice menu: their zone + one‐mile walk zone
Priorities:walk‐zone (50% of seats);Random number
Gale‐Shapley’s Deferred Acceptance (DA) Algorithm (since 06):
1. Student applies to top choice in menu.2. School tentatively accepts if space available; otherwise reject out least priority student.3. Remove choice from rejected student; iterate.
Problem: Unsustainable Transportation Costs + inequitable distribution
between neighborhoods.
Negative aspects of school choice
Unpredictable
Unsustainable Transportation Costs
Scatters Neighborhoods
Core issues
4/18/2018
22
Pros and Cons of Boston’s System in 2012
Cons
• High transportation cost for the city.
• Community dispersion.
• Uncertainty.
• Menu not centered around student.
• Inequities across zones.
Pros
Many choices help find better match.
Easy capacity planning.
More equitable than without choice.
2012‐2013 Boston reform: Home‐Based Plan
• Choice menus:• Closest 2 Tier 1 schools• Closest 4 Tier 1 or 2 schools• Closest 6 top 1,2 or 3 schools• Closest 3 “big” schools.
Keep using Deferred Acceptance with new menus.
Intuition:
• Decreasing menus to decrease busing costs.
• Menu centered on student’s home.
• Compensate students who live in “worse” neighborhoods with more choices.
Q: How will it perform? Based on the same model used for what would the “optimal” plan look like?
4/18/2018
23
How to Compare These Menus?3‐Zone Home‐Based
Build a model
“quality” distance
i.i.d. Gumbel with scale .
Walk‐zone indicator
• Data: • Students’ preferences under 3‐zone.
• Multinomial Logit (MNL):
• Estimate , , bymaximumlikelihood.
4/18/2018
24
Simulation Analysis
Menus Priorities
Choices
DA Algorithm
Home Location
School Assignment
2. Predict choices under new menus.
3. Evaluate outcome
1. Forecast # of applicants in each neighborhood
Illustration: Simulation Results for 3‐Zone
Expected utility (miles)
Average 7.4
10th percentile 6.6
Minimum 5.1
Expected utilitydistribution
Average busing (miles) 1.3
Bus coverage (sq. miles) 20.9
Average # of choices: 27.5
Prob. of getting top choice in menu
Top 1 63%
Top 3 84%
# of peers living withinhalf mile (median)
3.1
4/18/2018
25
Comparing 3‐Zone and Home‐BasedMetric 3‐Zone Home‐Based
Expected utility (miles)
Average 7.4
10th percentile 6.6
Minimum 5.1
Average busing (miles) 1.3
Bus coverage (sq. miles) 20.9
Average # of choices: 27.5
Prob. of getting top choice in menu
Top 1 63%
Top 3 84%
# of peers living within half mile (median)
3.1
7.0
6.1
4.5
0.6
8.5
14.8
64%
85%
5.0
Student’s utilities decrease slightly.
Busing is more than halved
Improved cohesion
Boston Adopts the Home‐Based Plan
Implemented across Boston Jan 2014.
4/18/2018
26
maximize: Average utility + Minimum utility (across neighborhoods)
subject to:
Capacity constraints
Average busing distance Home‐Based
Bus coverage area Home‐Based
menus
Optimization Formulation
Difficult computational problem: many feasible menus (simulation is impossible)
Ashlagi and Shi (2015) : a simplified algorithm in large markets.
Menu is a bit like assortment optimization (what do we show students with difference features
Optimized
7.5
6.7
6.5
0.6
8.3
15.0
85%
96%
5.0
Optimization ResultsMetric 3‐Zone Home‐Based
Expected utility (miles)
Average 7.4 7.0
10th percentile 6.6 6.1
Minimum 5.1 4.5
Average busing (miles) 1.3 0.6
Bus coverage (sq. miles) 20.9 8.5
Average # of choices: 27.5 14.8
Prob. of getting top choice in menu
Top 1 63% 64%
Top 3 84% 84%
# of peers living withinhalf mile (median)
3.1 5.0
Efficiency
Gains in
Equity
Predict‐ability
BusingSavings
Optimization achieves best of both worlds!