bcin: Bayesian credible interval when n >= 1

View source: R/bayes.R

bcinR Documentation

Bayesian credible interval when n >= 1

Description

Let X_i \sim N(\mu, \sigma^2). Let Y_i = X_i - A, \beta = \mu - A, and \nu = |\mu - A|/\sigma. Then, for a fixed value of \nu, this comes up with a (1-\alpha)100\% posterior credible interval of \mu where the prior is \pi(\beta) = |\beta|^{-1} or \pi(\mu) = |\mu - A|^{-1}. The full posterior distribution is generalized inverse normal (implemented by ginvnorm) with shape parameter n + 1, inverse mean of sum(y) / sum(y^2), and inverse variance 1 / (nu^2 * sum(y^2)).

Usage

bcin(x, A = 0, nu = 1, level = 0.95)

Arguments

x

a double

A

The prior center.

nu

The fixed value of nu.

level

The level of the credible interval

Value

The credible interval of the provided level.

Author(s)

David Gerard

See Also

ginvnorm(): The generalized inverse normal distribution.

Examples

set.seed(1)
x <- stats::rnorm(4, mean = 1, sd = 1)
bcin(x = x, A = 3)



nisone documentation built on Sept. 8, 2026, 5:08 p.m.