Description Usage Arguments Value Examples
View source: R/logPosteriorLGLFM.R
The log of the unnormalized posterior density 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 10 | logPosteriorLGLFM(
featureAllocation,
distribution,
X,
precisionX,
precisionA,
sdX,
sdA,
implementation = "scala"
)
|
featureAllocation |
An N-by-K binary feature allocation matrix. |
distribution |
A prior distribution of feature allocations, i.e., a
result from |
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 unnormalized posterior density.
1 2 3 4 5 6 7 8 9 10 11 | # 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)
logPosteriorLGLFM(Z, ibp(1,nItems), X, sdX=sigx, sdA=siga)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.