findThreshold {clst} | R Documentation |
Identify a distance threshold predicting whether a pairwise distance represents a comparison between objects in the same class (within-group comparison) or different classes (between-group comparison) given a matrix providing distances between objects and the group membership of each object.
findThreshold(dmat, groups, distances, method = "mutinfo", prob = 0.5, na.rm = FALSE, keep.dists = TRUE, roundCuts = 2, minCuts = 20, maxCuts = 300, targetCuts = 100, verbose = FALSE, depth = 1, ...) partition(dmat, groups, include, verbose = FALSE)
dmat |
Square matrix of pairwise distances. |
groups |
Object coercible to a factor identifying group
membership of objects corresponding to either edge of |
include |
vector (numeric or boolean) indicating which elements to retain in the output; comparisons including an excluded element will have a value of NA |
distances |
Optional output of |
method |
The method for calculating the threshold; only 'mutinfo' is currently implemented. |
prob |
Sets the upper and lower bounds of D as some quantile of the within class distances and between-class differences, respectively. |
na.rm |
If TRUE, excludes |
keep.dists |
If TRUE, the output will contain the |
roundCuts |
Number of digits to round cutoff values (see Details) |
minCuts |
Minimal length of vector of cutoffs (see Details). |
maxCuts |
Maximal length of vector of cutoffs (see Details) |
targetCuts |
Length of vector of cutoffs if conditions met by
|
verbose |
Terminal output is produced if TRUE. |
depth |
Private argument used to track level of recursion. |
... |
Extra arguments are ignored. |
findThreshold
is used internally in classify
, but
may also be used to calculate a starting value of $D$.
partition
is used to transform a square (or lower triangular)
distance matrix into a data.frame
containing a column of
distances ($vals
) along with a factor ($comparison
)
defining each distance as a within- or between-group
comparison. Columns $row
and $col
provide indices of
corresponding rows and columns of dmat
.
In the case of findThreshold
, output is a list with elements
decsribed below. In the case of partition
, output is the data.frame
returned as the element named $distances
in the output of
findThreshold
.
D |
The distance threshold (distance cutoff corresponding to the PMMI). |
pmmi |
Value of the point of maximal mutual information (PMMI) |
interval |
A vector of length 2 indicating the upper and lower bounds over which values for the threshold are evaluated. |
breaks |
A |
distances |
If |
method |
Character corresponding to input argument |
params |
Additional input parameters. |
Noah Hoffman
data(iris) dmat <- as.matrix(dist(iris[,1:4], method="euclidean")) groups <- iris$Species thresh <- findThreshold(dmat, groups, type="mutinfo") str(thresh)