params_CI: Function to estimate credible intervals

Description Usage Arguments Value Examples

Description

Estimate the mean and confidence intervals at a given probability for for Bayesian parameters estimates

Usage

1
params_CI(x, prob = 0.95)

Arguments

x

vector holding the parameter draw from a MCMC of a MCMC or HMCMC sampler

probability

quantile for the Creidble interval. Function only support 90 or 95 percent intervals.

Value

a vector holding, the mean, the lower credible intervals and the upper credible intervals

Examples

1
2
3
4
5
6
7
foo <- rnorm(1e4, 0.653, 0.192)
paramsCI(foo, prob=0.95)
paramsCI(bob, prob=0.90)
# apply on a matrix
bar <- matrix(rnorm(1e3*10,0.653, 0.192), ncol=10)
as.data.frame(t(apply(bar, 2, paramsCI, prob=0.95)))
#END

RoyChristian/startR documentation built on May 9, 2019, 10:34 a.m.