two_seven: Steps 2-7 of Algorithm 2.1, factored into a common function...

Description Usage Arguments Value

View source: R/common.R

Description

Steps 2–7 of Algorithm 2.1, factored into a common function that can be used by a variety of distance metrics

Usage

1
2
3
4
two_seven(A, L, t, filter = c("distributed", "local"), normlim = 2 * (1 -
  t), full_dist_fun = function(idx) vapply(1:nrow(idx), function(k) cor(A[,
  idx[k, 1]], A[, idx[k, 2]]), 1), filter_fun = function(v, t) v >= t,
  dry_run = FALSE, anti = FALSE, group = NULL)

Arguments

A

data matrix

L

truncated SVD of A

t

scalar threshold value

filter

"distributed" for full threshold evaluation of pruned set on parallel workers, "local" for sequential evaluation of full threshold of pruned set to avoid copying data matrix.

normlim

the squared norm limit in step 4, default value is for correlation

full_dist_fun

non-projected distance function of a two-column matrix of rows of column indices that needs scoped access to A (step 7), default function is for correlation

filter_fun

filter function of a vector and scalar that thresholds vector values from full_dist_fun, returning a logical vector of same length as v (step 7), default function is for correlation

dry_run

a logical value, if TRUE quickly return statistics useful for tuning p

anti

a logical value, if TRUE also include anti-correlated vectors

group

either NULL for no grouping, or a vector of length ncol(A) consisting of -1, 1 values indicating group membership of the columns.

Value

a list with indices, ell, tot, and longest_run entries, unless dry_run=TRUE in which case a list with ell and tot is returned


bwlewis/tcor documentation built on Sept. 6, 2020, 4:18 p.m.