logLik.LDA_VEM: Calculate the log likelihood of a VEM LDA model fit

View source: R/LDA.R

logLik.LDA_VEMR Documentation

Calculate the log likelihood of a VEM LDA model fit

Description

Imported but updated calculations from topicmodels package, as applied to Latent Dirichlet Allocation fit with Variational Expectation Maximization via LDA.

Usage

## S3 method for class 'LDA_VEM'
logLik(object, ...)

Arguments

object

A LDA_VEM-class object.

...

Not used, simply included to maintain method compatibility.

Details

The number of degrees of freedom is 1 (for alpha) plus the number of entries in the document-topic matrix. The number of observations is the number of entries in the document-term matrix.

Value

Log likelihood of the model logLik, also with df (degrees of freedom) and nobs (number of observations) values.

References

Buntine, W. 2002. Variational extensions to EM and multinomial PCA. European Conference on Machine Learning, Lecture Notes in Computer Science 2430:23-34. link.

Grun B. and K. Hornik. 2011. topicmodels: An R Package for Fitting Topic Models. Journal of Statistical Software 40:13. link.

Hoffman, M. D., D. M. Blei, and F. Bach. 2010. Online learning for latent Dirichlet allocation. Advances in Neural Information Processing Systems 23:856-864. link.

Examples

  data(rodents)
  lda_data <- rodents$document_term_table
  r_LDA <- LDA_set(lda_data, topics = 2)   
  logLik(r_LDA[[1]])


LDATS documentation built on Sept. 19, 2023, 5:08 p.m.