prec2sd: Convert the posterior marginal of a precision to a standard...

View source: R/prec2sd.R

prec2sdR Documentation

Convert the posterior marginal of a precision to a standard deviation

Description

Convert the posterior marginal of a precision to a standard deviation

Usage

prec2sd(marg)

Arguments

marg

A matrix with columns "y" and "x" where "y" is the marginal of the precision.

Value

A data.frame with the mean, standard deviation and 2.5%, 25%, 50%, 75% and 97.5% quantiles of the posterior of the standard deviation.

Examples

stopifnot(require(INLA))
model <- inla(Sepal.Length ~ Species, data = iris, family = "gaussian")
marg <- model$marginals.hyperpar[["Precision for the Gaussian observations"]]
prec2sd(marg)

inbo/inlatools documentation built on Oct. 10, 2024, 8:11 a.m.