posteriorDiscard: update the prior distribution with sufficient statistics

Description Usage Arguments Value See Also

View source: R/Bayesian_Bricks.r

Description

Contrary to posterior(), posteriorDiscard() a generic function that will update the prior distribution of a "BayesianBrick" object by removing the information provided by the observation's sufficient statistics. i.e. for the model structure:

theta|gamma \sim H(gamma)

x|theta \sim F(theta)

update gamma to gamma_posterior by removing the information of x from gamma. For a given sample set x or it's sufficient statistics ss, and a Bayesian bricks object obj, posteriorDiscard() will update the posterior parameters in obj for different model structures:

class(obj)="LinearGaussianGaussian"

x \sim Gaussian(A z + b, Sigma)

z \sim Gaussian(m,S)

posteriorDiscard() will update m and S in obj. See ?posteriorDiscard.LinearGaussianGaussian for details.

class(obj)="GaussianGaussian"

Where

x \sim Gaussian(mu,Sigma)

mu \sim Gaussian(m,S)

Sigma is known. posteriorDiscard() will update m and S in obj. See ?posteriorDiscard.GaussianGaussian for details.

class(obj)="GaussianInvWishart"

Where

x \sim Gaussian(mu,Sigma)

Sigma \sim InvWishart(v,S)

mu is known. posteriorDiscard() will update v and S in obj. See ?posteriorDiscard.GaussianInvWishart for details.

class(obj)="GaussianNIW"

Where

x \sim Gaussian(mu,Sigma)

Sigma \sim InvWishart(v,S)

mu \sim Gaussian(m,Sigma/k)

posteriorDiscard() will update m, k, v and S in obj. See ?posteriorDiscard.GaussianNIW for details.

class(obj)="GaussianNIG"

Where

x \sim Gaussian(X beta,sigma^2)

sigma^2 \sim InvGamma(a,b)

beta \sim Gaussian(m,sigma^2 V)

posteriorDiscard() will update m, V, a and b in obj. See ?posteriorDiscard.GaussianNIG for details.

class(obj)="CatDirichlet"

Where

x \sim Categorical(pi)

pi \sim Dirichlet(alpha)

posteriorDiscard() will update alpha in obj. See ?posteriorDiscard.CatDirichlet for details.

class(obj)="CatDP"

Where

x \sim Categorical(pi)

pi \sim DirichletProcess(alpha)

posteriorDiscard() will update alpha in obj. See ?posteriorDiscard.CatDP for details.

class(obj)="DP"

Where

pi|alpha \sim DP(alpha,U)

z|pi \sim Categorical(pi)

theta_z|psi \sim H0(psi)

x|theta_z,z \sim F(theta_z)

posteriorDiscard() will update alpha and psi in obj. See ?posteriorDiscard.DP for details.

class(obj)="HDP"

Where

G|gamma \sim DP(gamma,U)

pi_j|G,alpha \sim DP(alpha,G), j = 1:J

z|pi_j \sim Categorical(pi_j)

k|z,G \sim Categorical(G),\textrm{ if z is a sample from the base measure } G

theta_k|psi \sim H0(psi)

posteriorDiscard() will update gamma, alpha and psi in obj. See ?posteriorDiscard.HDP for details.

class(obj)="HDP2"

Where

G |eta \sim DP(eta,U)

G_m|gamma,G \sim DP(gamma,G), m = 1:M

pi_{mj}|G_m,alpha \sim DP(alpha,G_m), j = 1:J_m

z|pi_{mj} \sim Categorical(pi_{mj})

k|z,G_m \sim Categorical(G_m),\textrm{ if z is a sample from the base measure } G_m

u|k,G \sim Categorical(G),\textrm{ if k is a sample from the base measure } G

theta_u|psi \sim H0(psi)

x|theta_u,u \sim F(theta_u)

posteriorDiscard() will update eta, gamma, alpha and psi in obj. See ?posteriorDiscard.HDP2 for details.

Usage

1

Arguments

obj

A "BayesianBrick" object used to select a method.

...

further arguments passed to or from other methods.

Value

None, or an error message if the update fails.

See Also

posteriorDiscard.LinearGaussianGaussian for Linear Gaussian and Gaussian conjugate structure, posteriorDiscard.GaussianGaussian for Gaussian-Gaussian conjugate structure, posteriorDiscard.GaussianInvWishart for Gaussian-Inverse-Wishart conjugate structure, posteriorDiscard.GaussianNIW for Gaussian-NIW conjugate structure, posteriorDiscard.GaussianNIG for Gaussian-NIG conjugate structure, posteriorDiscard.CatDirichlet for Categorical-Dirichlet conjugate structure, posteriorDiscard.CatDP for Categorical-DP conjugate structure ...


bbricks documentation built on July 8, 2020, 7:29 p.m.