marginalLikelihood.GaussianGaussian {bbricks} | R Documentation |
Generate the marginal likelihood of the following model structure:
x \sim Gaussian(mu,Sigma)
mu \sim Gaussian(m,S)
Where Sigma is known. Gaussian() is the Gaussian distribution. See ?dGaussian
for the definition of Gaussian distribution.
The model structure and prior parameters are stored in a "GaussianGaussian" object.
Marginal likelihood = p(x|m,S,Sigma)
## S3 method for class 'GaussianGaussian' marginalLikelihood(obj, x, LOG = TRUE, ...)
obj |
A "GaussianGaussian" object. |
x |
matrix, or the ones that can be converted to matrix, each row of x is an observation. |
LOG |
Return the log density if set to "TRUE". |
... |
Additional arguments to be passed to other inherited types. |
numeric, the marginal likelihood.
Gelman, Andrew, et al. Bayesian data analysis. CRC press, 2013.
GaussianGaussian
, marginalLikelihood_bySufficientStatistics.GaussianGaussian
obj <- GaussianGaussian(gamma=list(Sigma=matrix(c(2,1,1,2),2,2),m=c(0.2,0.5),S=diag(2))) x <- rGaussian(100,c(0,0),Sigma = matrix(c(2,1,1,2),2,2)) marginalLikelihood(obj = obj,x=x,LOG = TRUE) marginalLikelihood(obj = obj,x=x,LOG = FALSE)