MinDistMatch: Matching on distance matrix

Description Usage Arguments Value Examples

View source: R/MinDistMatch_function.R

Description

Takes in a matrix and runs through it matching rows to columns with small entries. The smallest one is matched first, and it continues on.

Usage

1
MinDistMatch(M, caliper = NULL)

Arguments

M

A non-negative matrix (T x C)

caliper

The caliper controls how far apart with respect to their M entry matched pairs can be. When set to NULL, all possible matches with finite M entry are taken. If set to a number, no entries are allowed to be matched if larger than caliper.

Value

An ordered matrix of the row and column indices that are matched.

Examples

1
2
3
4
set.seed(1)
D <- matrix(rexp(800, rate = 0.5), 20, 40)
MinDistMatch(D, caliper = NULL)
MinDistMatch(D, caliper = 0.1)

gpapadog/DAPSm documentation built on May 17, 2019, 8 a.m.