logLik.BTM {BTM}R Documentation

Get the likelihood of biterms in a BTM model

Description

Get the likelihood how good biterms are fit by the BTM model

Usage

## S3 method for class 'BTM'
logLik(object, data = terms.BTM(object, type = "biterms")$biterms, ...)

Arguments

object

an object of class BTM as returned by BTM

data

a data.frame with 2 columns term1 and term2 containing biterms. Defaults to the biterms used to construct the model.

...

other arguments not used

Value

a list with elements

See Also

BTM, predict.BTM, terms.BTM

Examples


library(udpipe)
data("brussels_reviews_anno", package = "udpipe")
x <- subset(brussels_reviews_anno, language == "nl")
x <- subset(x, xpos %in% c("NN", "NNP", "NNS"))
x <- x[, c("doc_id", "lemma")]

model  <- BTM(x, k = 5, iter = 5, trace = TRUE, detailed = TRUE)
fit <- logLik(model)
fit$ll


[Package BTM version 0.3.7 Index]