alpha.schafer: Sch\"afer and Strimmer method to estimate shrinkage intensity

View source: R/alpha.schafer.R

alpha.schaferR Documentation

Sch\"afer and Strimmer method to estimate shrinkage intensity

Description

Estimates alpha shrinkage intensity parameter by the method proposed in Sch\"afer & Strimmer (2005), for "Target D", for improved estimation of population covariance matrices.

Usage

alpha.schafer(datamat, B, reps = 1000)

Arguments

datamat

Matrix containing sample data for the ith group.

B

Matrix of estimated common (and possibly non-common) eigenvectors. Can be estimated using simultaneous diagonalisation algorithms such as the Flury-Gautschi (implemented in FG or the stepwise CPC (implemented in stepwisecpc) algorithms.

reps

Number of bootstrap replications to use for estimation of the variances of the off-diagonal elements of the L_i. See Pepler (2014) for details.

Value

Returns the estimated shrinkage intensity (scalar), a value between 0 and 1.

Author(s)

Theo Pepler

References

Sch\"afer, J. and Strimmer, K. (2005). A shrinkage approach to large-scale covariance matrix estimation and implications for functional genomics. Statistical Applications in Genetics and Molecular Biology, 4(1): 1175-1189.

Pepler, P.T. (2014). The identification and application of common principal components. PhD dissertation in the Department of Statistics and Actuarial Science, Stellenbosch University.

See Also

alpha.crossvalid

Examples

# Versicolor and virginica groups of the Iris data
data(iris)
versicolor <- iris[51:100, 1:4]
virginica <- iris[101:150, 1:4]

# Create array containing the two covariance matrices
S <- array(NA, c(4, 4, 2))
S[, , 1] <- cov(versicolor)
S[, , 2] <- cov(virginica)
nvec <- c(nrow(versicolor), nrow(virginica))

# Estimate the modal matrix using the FG algorithm
B <- FG(covmats = S, nvec = nvec)$B

# Estimate optimal shrinkage intensity for the versicolor covariance matrix
alpha.schafer(datamat = versicolor, B = B)

tpepler/cpc documentation built on July 7, 2022, 2:13 a.m.