Usage
rRegMatch(X, r, y = NULL, dister = "daisy", dist.args = list(), keep.X = nrow(X) < 100, keep.D = (dister == "treeClust.dist"), relax = (N >= 100), thresh = 1e-6)
Arguments
X
Matrix or data frame of data, or inter-point distances represented in an object inheriting from "dist"
r
Integer number of matches. The matching is "regular" in that every observation is matched to exactly
r others (or, if relax=TRUE, every observation is matched to others with weights in [0, 1] that add up to r).
y
Vector of class membership indices. This is used to compute the cross-count statistic. Optional.
dister
Function to compute inter-point distances. This must take as its first argument
a matrix of data argument name x
. Default: daisy
.
If all the columns are numeric,
this produces unweighted Euclidean distance by default.
dist.args
List of argument to the dister
function.
keep.X
If TRUE, and X was supplied, keep the X matrix in the output object. Default:
TRUE if X was supplied and also nrow (X) < 100.
keep.D
If TRUE, keep the distance object in the output. Default: TRUE if the
treeClust.dist
function is being
used to compute the distances (since in that case the distances are random).
relax
If FALSE, solve the exact problem where each observation gets exactly r
non-zero pairings, each with weight 1. If TRUE, solve the relaxed problem,
where each observation has at least r non-zero pairings,
each with its own weight between 0 and 1, the weights adding up to r. The
exact problem gets very slow with large samples.
thresh
Weights smaller than this are considered to be exactly zero. Default: 1e-6.