nbpMatching-package {nbpMatching}R Documentation

Nonbipartite Matching

Description

This package will take an input distance matrix and generate the set of pairwise matches that minimizes the sum of distances between the pairs by running nonbimatch.

Author(s)

Bo Lu, Robert Greevy, Cole Beck

Maintainer: Cole Beck cole.beck@vanderbilt.edu

References

Lu, Greevy, Xu, and Beck. Optimal Nonbipartite Matching and its Statistical Applications. (under review)

Examples

plainmatrix<-as.matrix(dist(sample(1:25, 8, replace=TRUE)))
diag(plainmatrix) <- 99999  # setting diagonal to an infinite distance for
                            # pedagogical reasons (the diagonal may be left
                            # as zero)
mdm<-distancematrix(plainmatrix)
res<-nonbimatch(mdm)

## Not run: 
try a large matrix
nonbimatch(distancematrix(as.matrix(dist(sample(1:10^8, 5000, replace=TRUE)))))
## End(Not run)

[Package nbpMatching version 1.0 Index]