sim_dfm: Simulate a document-feature-matrix from a LDA specification

Description Usage Arguments Value Author(s) References See Also

View source: R/sim_dfm.R

Description

Simulate a document-feature-matrix from estimated DTW and TWW. The number of topics as well as the number of documents are inferred from the LDA parameters.

Usage

1
sim_dfm(DTW, TWW, doc_length, alpha = NULL, seed = NULL)

Arguments

DTW

A matrix or data.frame with Document-Topic-Weights.

TWW

A matrix or data.frame with Topic-Word-Weights.

doc_length

A vector containing the desired document length as total number of word counts.

alpha

Parameter of the Dirichlet distribution for topics over documents.

seed

Input to set.seed.

Value

A dfm object.

Author(s)

Francesco Grossetti francesco.grossetti@unibocconi.it

Craig M. Lewis craig.lewis@owen.vanderbilt.edu

References

Lewis, C. and Grossetti, F. (2019 - forthcoming):
A Statistical Approach for Optimal Topic Model Identification.

See Also

LDA dfm


contefranz/OpTop documentation built on Feb. 14, 2022, 7:04 p.m.