R/multinom2poisson.R
multinom2poisson.RdThis function recovers parameter estimates of the Poisson non-negative matrix factorization (NMF) given parameter estimates for a multinomial topic model.
multinom2poisson(fit, X)An object of class “multinom_topic_model_fit”,
such as an output from poisson2multinom. If a Poisson NMF
fit is provided (that is, an object of class
“poisson_nmf_fit”), the fit object is immediately returned
“as is”.
Optional n x m matrix of counts, or pseudocounts. It can
be a sparse matrix (class "dgCMatrix") or dense matrix
(class "matrix"). This only needs to be provided if the
document sizes fit$s are not available.
The return value is the list fit, in which matrices
fit$F and fit$L specify the factors and loadings in
the Poisson non-negative matrix factorization; specifically,
the counts matrix is modeled by the low-rank matrix product
tcrossprod(fit$L,fit$F).