MyNixOS website logo
Description

Analysis of Stable Matchings.

Implements structural estimators to correct for the sample selection bias from observed outcomes in matching markets. This includes one-sided matching of agents into groups (Klein, 2015) <https://www.econ.cam.ac.uk/research-files/repec/cam/pdf/cwpe1521.pdf> as well as two-sided matching of students to schools (Aue et al., 2020) <https://ftp.zew.de/pub/zew-docs/dp/dp20032.pdf>. The package also contains algorithms to find stable matchings in the three most common matching problems: the stable roommates problem (Irving, 1985) <doi:10.1016/0196-6774(85)90033-1>, the college admissions problem (Gale and Shapley, 1962) <doi:10.2307/2312726>, and the house allocation problem (Shapley and Scarf, 1974) <doi:10.1016/0304-4068(74)90033-0>.

matchingMarkets: Analysis of Stable Matchings in R

Documentation

Package documentation is available at matchingMarkets.org and the vignette is available from the CRAN page. An application of the estimator in function stabit is in Klein (2015).

Installation

Get started by installing the R software for statistical computing.

To get the latest stable version of the package from CRAN:

install.packages("matchingMarkets")
library(matchingMarkets)

Under Linux, the dependency package gmp requires that you have GNU MP (> 4.1.4) installed: $ sudo apt-get install libgmp-dev. See https://gmplib.org.

To get the most recent development version from GitHub:

install.packages("devtools")
devtools::install_github("thiloklein/matchingMarkets")
library(matchingMarkets)

or from R-Forge:

install.packages("matchingMarkets", repos="https://R-Forge.R-project.org")
library(matchingMarkets)

Java Note 1: If you get a Java error such as JAVA_HOME cannot be determined from the Registry, this can be resolved by either running install.packages() with the INSTALL_opts = "--no-multiarch" argument or by installing a Java version (i.e. 64-bit Java or 32-bit Java) that fits to the type of R version that you are using (i.e. 64-bit R or 32-bit R). This problem can easily effect Windows 7 users, since they might have installed a version of Java that is different than the version of R they are using. See this post and download the Java version from the Oracle website.

Java Note 2: If the installation of the dependent rJava package fails with configuration failed for package ‘rJava’, this can be fixed in Linux by $ sudo apt-get install r-cran-rjava.

Functions

The matchingMarkets R package comes with two estimators:

  • stabit: Implements a Bayes estimator that corrects for sample selection in matching markets when the selection process is a one-sided matching game (i.e. group formation).

  • stabit2: Implements the Bayes estimator for a two-sided matching game (i.e. the college admissions and stable marriage problems).

and algorithms that can be used to simulate matching data:

  • hri: Constraint model for the hospital/residents problem. Finds all stable matchings in two-sided matching markets. Implemented for both the stable marriage problem (one-to-one matching) and the hospital/residents problem, also known as college admissions problem (many-to-one matching).

  • hri2: Roth-Peranson Algorithm for the hospital/residents problem with couples. Finds the resident-optimal stable matching (if one exists) in the two-sided matching market.

  • iaa: Immediate Acceptance Algorithm (a.k.a. Boston mechanism): First-preference-first algorithm used for school choice in many countries. And Gale-Shapley Deferred Acceptance Algorithm.

  • sri: Constraint model for the stable roommates problem. Finds all stable matchings in the roommates problem (one-sided matching market).

  • plp: Partitioning Linear Programme. Finds the unique matching in the roommates problem (one-sided matching market) with transferable utility.

  • rsd: Random serial dictatorship mechanism.

  • ttc: Top-Trading-Cycles Algorithm. Finds efficient matchings in the housing market problem.

  • ttc2: Top-Trading-Cycles Algorithm for a two sided matching problem.

  • ttcc: Top-Trading-Cycles and Chains Algorithm for the kidney exchange problem.

Functions hri and sri are based on Patrick Prosser's n-ary constraint encoding model. They allow for incomplete preference lists (some agents find certain agents unacceptable) and unbalanced instances (unequal number of agents on both sides).

Metadata

Version

1.0-4

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows