PreEst.2017Lee: Bayesian Estimation of a Banded Precision Matrix (Lee 2017)

View source: R/PreEst.2017Lee.R

PreEst.2017LeeR Documentation

Bayesian Estimation of a Banded Precision Matrix (Lee 2017)

Description

PreEst.2017Lee returns a Bayes estimator of the banded precision matrix, which is defined in subsection 3.3 of Lee and Lee (2017), using the k-BC prior. The bandwidth is set at the mode of marginal posterior for the bandwidth parameter.

Usage

PreEst.2017Lee(
  X,
  upperK = floor(ncol(X)/2),
  logpi = function(k) {
     -k^4
 }
)

Arguments

X

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

upperK

upper bound of bandwidth k.

logpi

log of prior distribution for bandwidth k. Default is a function proportional to -k^4.

Value

a named list containing:

C

a (p\times p) MAP estimate for precision matrix.

References

\insertRef

lee_estimating_2017CovTools

Examples

## generate data from multivariate normal with Identity precision.
pdim = 5
data = matrix(rnorm(100*pdim), ncol=pdim)

## compare different K
out1 <- PreEst.2017Lee(data, upperK=1)
out2 <- PreEst.2017Lee(data, upperK=3)
out3 <- PreEst.2017Lee(data, upperK=5)

## visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(2,2), pty="s")
image(diag(pdim)[,pdim:1], main="Original Precision")
image(out1$C[,pdim:1],     main="banded2::upperK=1")
image(out2$C[,pdim:1],     main="banded2::upperK=3")
image(out3$C[,pdim:1],     main="banded2::upperK=5")
par(opar)


kyoustat/CovTools documentation built on Aug. 28, 2023, 2:17 p.m.