matchingMarkets: Analysis of Stable Matchings in R


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


Get started by installing the R software for statistical computing.

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


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

To get the most recent development version from GitHub:


or from R-Forge:

install.packages("matchingMarkets", repos="")

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.


The matchingMarkets R package comes with two estimators:

and algorithms that can be used to simulate matching data:

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).