opt_mid: Optimize mid point

Description Usage Arguments Value Examples

Description

The primary function - estimates the optimal cutoff and related statistics for evaluating the groups of the input distance matrix.

Usage

1
opt_mid(dist_mat, group = colnames(dist_mat)[1], params = c(0, 1))

Arguments

dist_mat

A [0, 1] bounded square distance matrix with column names matching groups.

group

A character string specifying group of interest. Default if first group in matrix.

params

A vector containing intitial values of cut_off and delta (respectively) passed optim function for parameter optimization.

Value

tibble containing: focal_group - the input group cut_off - the optimized cutoff value that most effectively clusters entities with the same label while excluding entities with alternative labels. delta - the optimized cutoff shrinkage parameter that ensures smaller cutoff values are favored when a range of cutoff values results in a similar mid_point value optim_value - the optimized value of (cut_off ^ delta + (prop grouped - prop exluded)^2), which determines parameter values. mid_point - the compromise between excluding all alternative entities from the focal group while capturing all the members of the focal group, as derived from the optimized cutoff value. A value of 1 means the focal group is perfectly separated from all other groups. converge - convergence dianostic from optim function. If converge != 0, try different initial values. Increasing delta is a good first choice.

Examples

1
2
3
4
5
set.seed(123)
sepal_dist <- iris$Sepal.Length %>% dist %>% as.matrix
sepal_dist <- sepal_dist/max(sepal_dist)
colnames(sepal_dist) <- iris$Species
opt_mid(sepal_dist, "setosa", params = c(0, 1))

silastittes/albatross documentation built on May 15, 2019, 5:52 p.m.