This is a generic function that will generate random samples from the posterior predictive distribution. i.e. for the model structure:
$$theta|gamma \sim H(gamma)$$
$$x|theta \sim F(theta)$$
generate x_new from the posterior predictive distribution of x|gamma.
For a given Bayesian bricks object obj, rPosteriorPredictive() will generate random samples from different model structures:
Where
$$x \sim Gaussian(A z + b, Sigma)$$
$$z \sim Gaussian(m,S)$$
rPosteriorPredictive() will generate samples from the distribution of x|m,S,A,b,Sigma
See ?rPosteriorPredictive.LinearGaussianGaussian for details.
Where
$$x \sim Gaussian(mu,Sigma)$$
$$mu \sim Gaussian(m,S)$$
Sigma is known.
rPosteriorPredictive() will generate samples from the distribution of x|m,S,Sigma
See ?rPosteriorPredictive.GaussianGaussian for details.
Where
$$x \sim Gaussian(mu,Sigma)$$
$$Sigma \sim InvWishart(v,S)$$
mu is known.
rPosteriorPredictive() will generate samples from the distribution of x|mu,v,S
See ?rPosteriorPredictive.GaussianInvWishart for details.
Where
$$x \sim Gaussian(mu,Sigma)$$
$$Sigma \sim InvWishart(v,S)$$
$$mu \sim Gaussian(m,Sigma/k)$$
rPosteriorPredictive() will generate samples from the distribution of x|m,k,v,S
See ?rPosteriorPredictive.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.
rPosteriorPredictive() will generate samples from the distribution of x,X|m,V,a,b
See ?rPosteriorPredictive.GaussianNIG for details.
Where
$$x \sim Categorical(pi)$$
$$pi \sim Dirichlet(alpha)$$
rPosteriorPredictive() will generate samples from the distribution of x|alpha
See ?rPosteriorPredictive.CatDirichlet for details.
Where
$$x \sim Categorical(pi)$$
$$pi \sim DirichletProcess(alpha)$$
rPosteriorPredictive() will generate samples from the distribution of x|alpha
See ?rPosteriorPredictive.CatDP for details.
rPosteriorPredictive(obj, n, ...)A "BayesianBrick" object used to select a method.
integer, specify the number of samples to be generated.
further arguments passed to or from other methods.
a matrix or vector or list of random samples, depends on the type of 'obj'.
rPosteriorPredictive.GaussianNIW for Gaussian-NIW conjugate structure, rPosteriorPredictive.GaussianNIG for Gaussian-NIG conjugate structure, rPosteriorPredictive.CatDirichlet for Categorical-Dirichlet conjugate structure, rPosteriorPredictive.CatDP for Categorical-DP conjugate structure ...