CredibleInterval: Bayesian credible interval

Description Usage Arguments Details Value Author(s) Examples

View source: R/prog.R

Description

Computes the shortest credible interval at the desired level.

Usage

1
CredibleInterval(a_chain, level = 0.95)

Arguments

a_chain

numeric vector containing the output of the MCMC algorithm for a one-parameter

level

probability corresponding to the level of confidence used for the credible interval

Details

A (100 * level) % credible intervalgives the shortest interval, whose posterior probability is equal to the desired level. This interval is approximated by constructing the shortest interval such that N*(1-level) elements of the sample are outside the interval.

Value

Returns a vector of values containing the level of confidence and the endpoints of the shortest credible interval.

Author(s)

Anne Philippe <Anne.Philippe@univ-nantes.fr> and

Marie-Anne Vibet <Marie-Anne.Vibet@univ-nantes.fr>

Examples

1
2
3
4

Example output

              level CredibleIntervalInf CredibleIntervalSup 
               0.95            -1981.05            -1610.60 
              level CredibleIntervalInf CredibleIntervalSup 
               0.50            -1291.70            -1184.26 

RChronoModel documentation built on May 1, 2019, 10:06 p.m.