Skip to contents

Native eigenvalue closed forms that reproduce poolr::meff (methods "galwey", "liji", "nyholt"), including its conventions: Galwey sets negative eigenvalues to zero, Li-Ji works on \(|\lambda_i| + \sqrt{\epsilon}\), Nyholt uses all eigenvalues, and the estimate is rounded down to an integer.

Usage

n_effective_tests(correlation_matrix, method = c("galwey", "li_ji", "nyholt"))

Arguments

correlation_matrix

Square symmetric correlation matrix.

method

One of "galwey" (Galwey 2009), "li_ji" (Li and Ji 2005), or "nyholt" (Nyholt 2004).

Value

Effective number of tests: floor() of the estimator, bounded below by 1.

Examples

set.seed(1)
X <- matrix(rnorm(200), ncol = 5)
n_effective_tests(stats::cor(X))
#> [1] 4