Learn R Programming

bspcov (version 1.0.3)

quantile.bspcov: Quantiles of posterior distribution

Description

Compute quantiles to describe posterior distribution. For multiple chains, combines all chains to compute more robust quantiles.

Usage

# S3 method for bspcov
quantile(x, probs = c(0.025, 0.5, 0.975), ...)

Value

quantiles

a list containing quantile matrices for each probability level. For multiple chains, uses combined samples from all chains.

Arguments

x

an object from bandPPP, bmspcov, sbmspcov, and thresPPP.

probs

numeric vector of probabilities with values in [0,1]. Default is c(0.025, 0.5, 0.975).

...

additional arguments for quantile.

Author

Kyeongwon Lee

See Also

estimate, plot.postmean.bspcov

Examples

Run this code
# \donttest{
# Example with simulated data
n <- 25
p <- 50
Sigma0 <- diag(1, p)
X <- MASS::mvrnorm(n = n, mu = rep(0, p), Sigma = Sigma0)
res <- bspcov::bandPPP(X, 2, 0.01, nsample=100)
quant <- quantile(res)

# Get 95% credible intervals
quant <- quantile(res, probs = c(0.025, 0.975))
# }

Run the code above in your browser using DataLab