getTarget: Construct a target matrix for single target linear shrinkage

Description Usage Arguments Value See Also Examples

View source: R/RcppExports.R

Description

Construct a popular target matrix from the linear shrinkage literature. These targets consist of a combination of variance and correlation structure. Possible variance structures are unit, sample mean, and sample. Possible correlation structures are zero, sample mean, and autocorrelation.

Usage

1
getTarget(X, varNumber = 2L, corNumber = 1L)

Arguments

X

matrix – data matrix with variables in rows and observations in columns.

varNumber

numeric – c(1, 2, 3) variance structure for the target matrix. 1 sets all variances equal to 1. 2 sets all variances equal to their sample mean (using X). 3. sets all variances to their sample values (using X).

corNumber

numeric – c(1, 2, 3) correlation structure for the target matrix. 1 sets the correlations to 0. 2 sets the correlations equal to their sample mean (using X). 3 sets the correlations equals to an autocorrelation structure with parameter equal to the sample mean (using X).

Value

matrix – target matrix for linear shrinkage estimation.

See Also

gcShrink

Examples

1
2
3
4
5
6
  set.seed(102)
  X <- matrix(rnorm(50), 10, 5) # p=10, n=5, identity covariance
  X <- t(scale(t(X), center=TRUE, scale=FALSE)) # mean 0
  getTarget(X, varNumber = 1, corNumber = 1) # unit variance, zero correlation
  getTarget(X, varNumber = 2, corNumber = 1) # equal variance, zero correlation
  getTarget(X, varNumber = 3, corNumber = 1) # sample variances, zero correlation

HGray384/TAS documentation built on Dec. 14, 2020, 8:41 p.m.