logdetCI {heplots} | R Documentation |
Calculate confidence interval for log determinant of covariance matrices
Description
This function uses asymptotic results described by Cai et. al (2016), Theorem 1, to calculate approximate, normal theory confidence intervals (CIs) for the log determinant of one or more sample covariance matrices.
Usage
logdetCI(cov, n, conf = 0.95, method = 1, bias.adj = TRUE)
Arguments
cov |
a covariance matrix or a (named) list of covariance matrices, all the same size |
n |
sample size, or vector of sample sizes, one for each covariance matrix |
conf |
confidence level |
method |
Three methods are provided, based on Cai et. al Theorem 1
( |
bias.adj |
logical; set |
Details
Their results are translated into a CI via the approximation
where
is the sample estimate of a population covariance matrix,
is a bias correction constant and
is a width factor for
the confidence interval. Both
and
are functions of the
sample size,
and number of variables,
.
This function is included here only to provide an approximation to
graphical accuracy for use with Box's M test for equality of
covariance matrices, boxM
and its associated
plot.boxM
method.
Cai et. al (2015) claim that their Theorem 1 holds with either fixed
or
growing with
, as long as
. Their
Corollary 1 (
method=2
) is the special case when is fixed.
Their Corollary 2 (
method=3
) is the special case when is fixed.
The properties of this CI estimator are unknown in small to moderate sample sizes, but it seems to be the only one available. It is therefore experimental in this version of the package and is subject to change in the future.
The term offsets the confidence interval from the sample estimate
of
. When
is large relative to
, the confidence interval may not overlap the sample estimate.
Strictly speaking, this estimator applies to the MLE of the covariance
matrix , i.e., using
rather than
in
as the divisor. The factor
has not yet been taken into
account here.
Value
A data frame with one row for each covariance matrix. lower
and upper
are the boundaries of the confidence intervals. Other
columns are logdet, bias, se
.
Author(s)
Michael Friendly
References
Cai, T. T.; Liang, T. & Zhou, H. H. (2015) Law of log determinant of sample covariance matrix and optimal estimation of differential entropy for high-dimensional Gaussian distributions. Journal of Multivariate Analysis, 137, 161-172. doi:10.1016/j.jmva.2015.02.003
See Also
Examples
data(iris)
iris.mod <- lm(as.matrix(iris[,1:4]) ~ iris$Species)
iris.boxm <- boxM(iris.mod)
cov <- c(iris.boxm$cov, list(pooled=iris.boxm$pooled))
n <- c(rep(50, 3), 150)
CI <- logdetCI( cov, n=n, conf=.95, method=1)
CI
plot(iris.boxm, xlim=c(-14, -8), main="Iris data, Box's M test", gplabel="Species")
arrows(CI$lower, 1:4, CI$upper, 1:4, lwd=3, angle=90, len=.1, code=3)
CI <- logdetCI( cov, n=n, conf=.95, method=1, bias.adj=FALSE)
CI
plot(iris.boxm, xlim=c(-14, -8), main="Iris data, Box's M test", gplabel="Species")
arrows(CI$lower, 1:4, CI$upper, 1:4, lwd=3, angle=90, len=.1, code=3)