find.cluster: cluster detection

Description Usage Arguments Details

View source: R/multivariance-functions.R

Description

Performs the detection of dependence structures algorithm until a cluster is found. This function is the basic building block dependence.structure. Advanced users, might use it directly.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
find.cluster(
  x,
  vec = 1:ncol(x),
  list.cdm = cdms(x, vec = vec),
  mem = as.numeric(1:max(vec)),
  cluster.to.vertex = 1:max(mem),
  vertex.to.cdm = 1:max(mem),
  previous.n.o.cdms = rep(0, max(mem)),
  all.multivariances = numeric(0),
  g = igraph::add.vertices(igraph::graph.empty(, directed = FALSE), max(mem), label =
    sapply(1:max(mem), function(r) paste(colnames(x, do.NULL = FALSE, prefix = "")[vec ==
    r], collapse = ",")), shape = "circle"),
  fixed.rejection.level = NA,
  alpha = 0.05,
  p.adjust.method = "holm",
  verbose = TRUE,
  kvec = 2:max(mem),
  parameter.range = NULL,
  type = "conservative",
  stop.too.many = NULL,
  ...
)

Arguments

x

matrix with the samples

vec

vector, it indicates which columns are initially treated together as one sample

list.cdm

list of doubly centered distance matrices

mem

numeric vector, its length is the number of vertices, its content is the number of the corresponding cluster for the current iteration, i.e., vertex i belongs to cluster mem[i]

cluster.to.vertex

vector, contains the cluster to vertex relations, i.e., cluster.to.vertex[i] is the index of the vertex which represents cluster i

vertex.to.cdm

vector, contains the vertex to doubly centered distance matrix relations, i.e., vertex.to.cdm[i] is the index of the doubly centered distance matrix in list.cdm which corresponds to vertex i

previous.n.o.cdms

vector, number of the doubly centered distance matrices in the previous iteration (it is used to ensure that previously check tuples are not checked again)

all.multivariances

vector, which contains all distance multivariances which have been calculated so far. Only used to finally return all distance multivariances which have been calculated.

g

dependence structure graph

fixed.rejection.level

vector, if not NA the fixed.rejection.level[k] is used for the k-tuples, instead of a level derived from the significance level alpha

alpha

numeric, significance level used for the (distribution-free) tests

p.adjust.method

name of the method used to adjust the p-values for multiple testing, see p.adjust for all possible options.

verbose

boolean, if TRUE details during the detection are printed and whenever a cluster is newly detected the (so far) detected dependence structure is plotted.

kvec

vector, k-tuples are only checked for each k in kvec, i.e., for kvec = 2:4 only 2,3 and 4-tuples would be check and then the algorithm stops.

parameter.range

numeric matrix, which hosts the range of significance levels or 'c.factor' which yield the same detected structure

type

the method for the detection, one of 'conservative','resample','pearson_approx' or 'consistent'.

stop.too.many

numeric, upper limit for the number of tested tuples. A warning is issued if it is used. Use stop.too.many = NULL for no limit.

...

are passed to resample.multivariance in the case of 'type = resample'

Details

For further details see dependence.structure.


multivariance documentation built on Oct. 6, 2021, 5:08 p.m.