BCovTest1.mxPBF {CovTools} | R Documentation |
One-Sample Covariance Test using Maximum Pairwise Bayes Factor
Description
It performs Bayesian version of 1-sample test for Covariance where the null hypothesis is
where is the covariance of data model and
is a
hypothesized covariance. Denote
be the
-th column of data matrix.
Under the maximum pairwise Bayes Factor framework, we have following hypothesis,
The model is
and the prior is set, under , as
Usage
BCovTest1.mxPBF(data, Sigma0 = diag(ncol(data)), a0 = 2, b0 = 2, gamma = 1)
Arguments
data |
an |
Sigma0 |
a |
a0 |
shape parameter for inverse-gamma prior. |
b0 |
scale parameter for inverse-gamma prior. |
gamma |
non-negative number. See the equation above. |
Value
a named list containing:
- log.BF.mat
a
matrix of pairwise log Bayes factors.
References
Lee K, Lin L, Dunson D (2018). “Maximum Pairwise Bayes Factors for Covariance Structure Testing.” arXiv preprint. https://arxiv.org/abs/1809.03105.
Examples
## Not run:
## generate data from multivariate normal with trivial covariance.
pdim = 10
data = matrix(rnorm(100*pdim), nrow=100)
## run mxPBF-based test
out1 = BCovTest1.mxPBF(data)
out2 = BCovTest1.mxPBF(data, a0=5.0, b0=5.0) # change some params
## visualize two Bayes Factor matrices
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,2), pty="s")
image(exp(out1$log.BF.mat)[,pdim:1], main="default")
image(exp(out2$log.BF.mat)[,pdim:1], main="a0=b0=5.0")
par(opar)
## End(Not run)