generate_sample {tidylda}R Documentation

Generate a sample of LDA posteriors

Description

Helper function called by both posterior.tidylda and predict.tidylda to generate samples from the posterior.

Usage

generate_sample(dir_par, matrix, times)

Arguments

dir_par

matrix of Dirichlet hyperparameters, one column per

matrix

character of "theta" or "beta", indicating which posterior matrix dir_par's columns are from.

times

Integer, number of samples to draw.

Value

Returns a tibble with one row per parameter per sample.


[Package tidylda version 0.0.5 Index]