linshrink {nlshrink}R Documentation

Linear-shrinkage estimator of population eigenvalues.

Description

linshrink estimates the population eigenvalues from the sample eigenvalues by shrinking each sample eigenvalue towards the global mean based on a shrinkage factor. Details in referenced publications.

Usage

linshrink(X, k = 0)

Arguments

X

A data matrix.

k

(Optional) Non-negative integer less than ncol(X). If k == 0 (default), X is assumed to contain 1 class, which will be centered. If k >= 1, X is assumed to contain k classes, each of which has already been centered.

Value

A numeric vector of length ncol(X), containing the population eigenvalue estimates sorted in ascending order.

References

Examples

linshrink(X = matrix(rnorm(1e4, mean = 5), nrow = 100, ncol = 100)) # 1 class; will be centered
linshrink(X = matrix(rnorm(1e4), nrow = 100, ncol = 100), k = 1) # 1 class; no centering

[Package nlshrink version 1.0.1 Index]