Learn R Programming

CovTools (version 0.5.0)

BayesTest1: Bayesian One-Sample Tests for Covariance Matrix

Description

Given data, BayesTest1 performs Bayesian version of 1-sample test for Covariance where the null hypothesis is $$H_0 : \Sigma_n = \Sigma_0$$ where \(\Sigma_n\) is the covariance of data model and \(\Sigma_0\) is a hypothesized covariance.

Usage

BayesTest1(data, Sigma0 = diag(ncol(data)), method = c("mxPBF"), ...)

Arguments

data

an \((n\times p)\) data matrix where each row is an observation.

Sigma0

a \((p\times p)\) given covariance matrix.

method

a name of test.

...

extra arguments to be passed along for each procedure. See below for details.

parameter method description
a0 "mxPBF" hyperparameter (see below for details)
b0 "mxPBF" hyperparameter (see below for details)

Value

a named list containing one of followings,

element method description

mxPBF

Let \(X_i\) be the \(i\)-th column of data matrix. Under the maximum pairwise bayes factor framework, we have following hypothesis, $$H_0: a_{ij}=0~\mathrm{ and }~\tau_{ij}=1 \quad \mathrm{versus. } \quad H_1: \mathrm{ not }~ H_0.$$ The model is $$X_i | X_j \sim N_n( a_{ij}X_j, \tau_{ij}^2 I_n )$$ and the prior is set, under \(H_1\), as $$ a_{ij}|\tau_{ij}^2 \sim N(0, \tau_{ij}^2/(\gamma*||X_j||^2))$$ $$\tau_{ij}^2 \sim IG(a0, b0).$$

References

lee_maximum_2018CovTools

Examples

Run this code
# NOT RUN {
## generate data from multivariate normal with trivial covariance.
data = matrix(rnorm(100*5), nrow=100)

## run test
BayesTest1(data)                 # default setting
BayesTest1(data, a0=5.0, b0=5.0) # change hyperparameters
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab