sample_tokens_given_topics: Sample types for a given setup of topic indicators

Description Usage Arguments Value References Examples

Description

The function is sampling new word types based on posterior mode without hyper parameters.

This function is used for modeling comparisons using Bayesian checking. See reference for details.

Usage

1

Arguments

state

a topic model state object

n

The number of random draws of tokens given topic.

Value

A tidy dataset with simulated tokens.

References

Mimno, D. and Blei, D. Bayesian Checking for Topic Models

Examples

1
2
3
# Load the state of the union topic model
data("sotu50")
w <- sample_tokens_given_topics(state = sotu50, n = 5)

MansMeg/tidytopics documentation built on May 8, 2019, 3:52 p.m.