permute_fit: Permutation of opt_mid_multi for non parametric significance...

Description Usage Arguments Value Examples

View source: R/albatross_functions.R

Description

Permutation of opt_mid_multi for non parametric significance testing

Usage

1
2
permute_fit(dist_mat, groups = unique(colnames(dist_mat)), params = c(0, 1),
  n_permutes = 10)

Arguments

dist_mat

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

groups

A character vector specifying groups of interest. Defualt is all groups.

params

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

n_permutes

A positive integer from the number of random label permutations to be conducted.

Value

tibble containing a row for each input group with columns: 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.Width %>% dist %>% as.matrix
sepal_dist <- sepal_dist/max(sepal_dist)
colnames(sepal_dist) <- iris$Species
permute_fit(dist_mat = sepal_dist, params = c(0.1, 10))

silastittes/albatross documentation built on April 19, 2018, 3:31 a.m.