elbowEigen: Alternative methods based on the detection of elbow in sample...

Description Usage Arguments Value Examples

View source: R/alternative.R

Description

The function returns the dimension that is selected based on various methods that attempt to detect an “elbow” in sample eigenvalues.

Usage

1
elbowEigen(lambda, methods = c("adjD", "cumD", "varD", "cumlog", "logsigma2"))

Arguments

lambda

a numeric vector of positive sample eigenvalues of length n

methods

a character vector of possible methods to detect an elbow in sample eigenvalues.

Value

an integer $K$ between 1 and $n$.

Examples

1
2
3
4
5
6
7
8
## Not run: 
library(MASS)
X <- mvrnorm(1000, mu = rep(0,10), Sigma = diag(1,10))
eigen_values <- eigen(as.matrix(Matrix::nearPD(stats::cov(scale(X)))$mat))$val
elbowEigen(lambda = eigen_values)
elbowEigen(lambda = eigen_values)

## End(Not run)

WeiAkaneDeng/SPAC2 documentation built on Jan. 15, 2022, 5:01 a.m.