Learn R Programming

matchingR (version 1.0.1)

one2one: Compute one-to-one matching

Description

This function returns the proposer-optimal one-to-one matching. The function needs some description of individuals preferences as inputs. That can be in the form of cardinal utilities or preference orders (or both).

Usage

one2one(proposerUtils = NULL, reviewerUtils = NULL, proposerPref = NULL,
  reviewerPref = NULL)

Arguments

proposerUtils
is a matrix with cardinal utilities of the proposing side of the market
reviewerUtils
is a matrix with cardinal utilities of the courted side of the market
proposerPref
is a matrix with the preference order of the proposing side of the market (only required when proposerUtils is not provided)
reviewerPref
is a matrix with the preference order of the courted side of the market (only required when reviewerUtils is not provided)

Examples

Run this code
nmen = 25
nwomen = 20
uM = matrix(runif(nmen*nwomen), nrow=nmen, ncol=nwomen)
uW = matrix(runif(nwomen*nmen), nrow=nwomen, ncol=nmen)
results = one2one(uM, uW)

prefM = sortIndex(uM)
prefW = sortIndex(uW)
results = one2one(proposerPref = prefM, reviewerPref = prefW)

Run the code above in your browser using DataLab