Description Usage Arguments Value See Also Examples
View source: R/logLikelihoodLGLFM.R
The log of the likelihood of a feature allocation from the linear Gaussian latent
feature model (LGLFM) is computed. The standard deviation of the error term
(sdX
) may be supplied or the associated precision (precisionX
)
can be provided instead. Likewise, only one of sdA
and
precisionA
should be supplied.
1 2 3 4 5 6 7 8 9 | logLikelihoodLGLFM(
featureAllocation,
X,
precisionX,
precisionA,
sdX,
sdA,
implementation = "scala"
)
|
featureAllocation |
An N-by-K binary feature allocation matrix. |
X |
An N-by-D matrix of observed data. |
precisionX |
The scalar precision of the data error variance. This must
be specified if |
precisionA |
The scalar precision of a latent feature. This must be
specified if |
sdX |
The scalar standard deviation of the data error variance. This
must be specified if |
sdA |
The scalar precision of a latent feature. This must be specified
if |
implementation |
The default of |
A numeric vector giving the log of the likelihood.
This function is an implementation of the log of Equation (26) in "The Indian Buffet Process: An Introduction and Review" by Griffiths and Ghahramani (2011) in the Journal of Machine Learning.
1 2 3 4 5 6 7 8 9 10 | # Regardless of size, the initial warmup can exceed CRAN's 5 seconds threshold
sigx <- 0.1
siga <- 1.0
dimA <- 1
nItems <- 8 # Should be a multiple of 4
Z <- matrix(c(1,0,1,1,0,1,0,0),byrow=TRUE,nrow=nItems,ncol=2)
A <- matrix(rnorm(ncol(Z)*dimA,sd=siga),nrow=ncol(Z),ncol=dimA)
e <- rnorm(nrow(Z)*ncol(A),0,sd=sigx)
X <- Z %*% A + e
logLikelihoodLGLFM(Z, X, sdX=sigx, sdA=siga)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.