Description Usage Arguments Value See Also Examples
Construct a set of popular target matrices from the linear shrinkage literature. These nine targets consist of the combinations of variance and correlation structures; variance structures are unit, sample mean, and sample; correlation structures are zero, sample mean, and autocorrelation.
1 | getTargetSet(X)
|
X |
|
array
– a p
xp
x9 array of
target matrices, where p
is the number of variables of X
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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
ts <- getTargetSet(X) # an array of targets
# inspect the variances of the targets
vars <- apply(ts, 3, diag)
colnames(vars) <- paste("target", c(1:9), sep="")
vars
boxplot(vars, ylab = "variances")
# inspect the correlations of the targets
corrs <- apply(ts, 3, function(x){cov2cor(x)[lower.tri(x)]})
colnames(corrs) <- paste("target", c(1:9), sep="")
corrs
boxplot(corrs, ylab = "correlations")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.