R/poisson2multinom.R
poisson2multinom.Rd
This function recovers parameter estimates of the multinomial topic model given parameter estimates for a Poisson non-negative matrix factorization (NMF).
poisson2multinom(fit)
An object of class “poisson_nmf_fit”, such as an
output from fit_poisson_nmf
. It does not make sense for a
multinomial topic model to have less than two topics, so an error
will be reported when k < 2, where k is the rank of the matrix
factorization. If a multinomial topic model fit is provided (that
is, an object of class “multinom_topic_model_fit”), the fit
object is immediately returned “as is”.
The return value is the list fit
, in which
fit$F
and fit$L
are the parameters of the multinomial
topic model; specifically, fit$L[i,]
gives the topic
probabilities for sample or document i, and fit$F[,k]
gives
the term probabilities for topic k. An additional vector
fit$s
of length n is returned giving the "size factors".