Description Usage Arguments Value See Also
View source: R/Bayesian_Bricks.r
This is a generic function that will generate random samples from the posterior distribution. i.e. for the model structure:
theta|gamma \sim H(gamma)
x|theta \sim F(theta)
generate random sampels of theta from the distribution theta \sim H(gamma).
For a given Bayesian bricks object obj, rPosterior()
will generate random samples for different model structures:
Where
x \sim Gaussian(A z + b, Sigma)
z \sim Gaussian(m,S)
rPosterior()
will generate random samples from Gaussian(m,S)
See ?rPosterior.LinearGaussianGaussian
for details.
Where
x \sim Gaussian(mu,Sigma)
mu \sim Gaussian(m,S)
Sigma is known.
rPosterior()
will generate random samples from Gaussian(m,S)
See ?rPosterior.GaussianGaussian
for details.
Where
x \sim Gaussian(mu,Sigma)
Sigma \sim InvWishart(v,S)
mu is known.
rPosterior()
will generate random samples from InvWishart(v,S)
See ?rPosterior.GaussianInvWishart
for details.
Where
x \sim Gaussian(mu,Sigma)
Sigma \sim InvWishart(v,S)
mu \sim Gaussian(m,Sigma/k)
rPosterior()
will generate random samples from NIW(m,k,v,S)
See ?rPosterior.GaussianNIW
for details.
Where
x \sim Gaussian(X beta,sigma^2)
sigma^2 \sim InvGamma(a,b)
beta \sim Gaussian(m,sigma^2 V)
X is a row vector, or a design matrix where each row is an obervation.
rPosterior()
will generate random samples from NIG(m,V,a,b)
See ?rPosterior.GaussianNIG
for details.
Where
x \sim Categorical(pi)
pi \sim Dirichlet(alpha)
rPosterior()
will generate random samples from Dirichlet(alpha)
See ?rPosterior.CatDirichlet
for details.
1 | rPosterior(obj, ...)
|
obj |
A "BayesianBrick" object used to select a method. |
... |
further arguments passed to or from other methods. |
numeric, the density value
rPosterior.LinearGaussianGaussian
for Linear Gaussian and Gaussian conjugate structure, rPosterior.GaussianGaussian
for Gaussian-Gaussian conjugate structure, rPosterior.GaussianInvWishart
for Gaussian-Inverse-Wishart conjugate structure, rPosterior.GaussianNIW
for Gaussian-NIW conjugate structure, rPosterior.GaussianNIG
for Gaussian-NIG conjugate structure, rPosterior.CatDirichlet
for Categorical-Dirichlet conjugate structure ...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.