logLik.multinom_TS_fit: Log likelihood of a multinomial TS model

Description Usage Arguments Value Examples

View source: R/multinom_TS.R

Description

Convenience function to simply extract the logLik element (and df and nobs) from a multinom_TS_fit object fit by multinom_TS. Extends logLik from multinom to multinom_TS_fit objects.

Usage

1
2
## S3 method for class 'multinom_TS_fit'
logLik(object, ...)

Arguments

object

A multinom_TS_fit-class object.

...

Not used, simply included to maintain method compatibility.

Value

Log likelihood of the model, as class logLik, with attributes df (degrees of freedom) and nobs (the number of weighted observations, accounting for size differences among documents).

Examples

1
2
3
4
5
6
7
8
9
  data(rodents)
  dtt <- rodents$document_term_table
  lda <- LDA_set(dtt, 2, 1, list(quiet = TRUE))
  dct <- rodents$document_covariate_table
  dct$gamma <- lda[[1]]@gamma
  weights <- document_weights(dtt)
  mts <- multinom_TS(dct, formula = gamma ~ 1, changepoints = c(20,50),
                     timename = "newmoon", weights = weights)
  logLik(mts)

weecology/LDATS documentation built on March 28, 2020, 11:20 a.m.