gsbBayesUpdate: Bayesian Update

View source: R/package.r

gsbBayesUpdateR Documentation

Bayesian Update

Description

Bayesian update from prior and data to posterior for normally distributed data with known sigma.

Usage

gsbBayesUpdate(alpha, beta, meanData, precisionData, with.alpha = TRUE)

Arguments

alpha

vector of prior means.

beta

vector of prior precisions.

meanData

vector of means from data.

precisionData

vector of precisions from data.

with.alpha

logical. If with.alpha = TRUE, alpha, beta, meanData and precisionData has to be specified and the posterior means, posterior precisions and weights are returned. Else only beta and precisionData has to be specified and the posterior precisions and weights are returned.

Value

alpha

posterior means. Only if with.alpha = TRUE.

beta

posterior precisions.

weight

weights of the priors relative to the whole information after updating.

Note

This function is used in the function gsb().

Author(s)

Florian Gerber <florian.gerber@math.uzh.ch>, Thomas Gsponer

See Also

gsb

Examples

## One dimensional case, with.alpha = FALSE
gsbBayesUpdate(beta=10,precisionData=20, with.alpha=FALSE)

## Two dimensional case, with.alpha = TRUE
gsbBayesUpdate(alpha=c(5,6),beta=c(10,11),meanData=c(10,11),
               precisionData=c(20,21),with.alpha=TRUE)

gsbDesign documentation built on May 29, 2024, 4:19 a.m.