View source: R/toptradingcycle.R
toptrading.checkStability | R Documentation |
Check if there are any pairs of agents who would rather swap houses with each other rather than be with their own two current respective partners.
toptrading.checkStability(utils = NULL, pref = NULL, matchings)
utils |
is a matrix with cardinal utilities of all individuals in the
market. If there are |
pref |
is a matrix with the preference order of all individuals in the
market. This argument is only required when |
matchings |
is a vector of length |
true if the matching is stable, false otherwise
pref <- matrix(c( 2, 4, 3, 4, 3, 3, 4, 2, 4, 2, 2, 1, 1, 1, 1, 3 ), byrow = TRUE, nrow = 4) pref results <- toptrading(pref = pref) results toptrading.checkStability(pref = pref, matchings = results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.