lda_acgs: Augmented collapsed Gibbs sampler (ACGS) for LDA

Description Usage Arguments Value See Also

View source: R/lda_acgs.R

Description

This a Markov chain on (z, β, θ) extending the collapsed Gibbs sampler (CGS) of Griffiths and Steyvers (2004)—a Markov chain on z.

Usage

1
2
lda_acgs(K, V, wid, doc.N, alpha.v, eta, max.iter = 100, burn.in = 0,
  spacing = 1, save.z = 0, save.beta = 0, save.theta = 0, save.lp = 0)

Arguments

K

Number of topics in the corpus

V

Vocabulary size

wid

Vocabulary ids of every word instance in each corpus document (1 X total.N vector). We assume vocabulary id starts with 1

doc.N

Documents' word counts

alpha.v

Hyperparameter vector for θ

eta

Smoothing parameter for the β matrix

max.iter

Maximum number of Gibbs iterations to be performed

burn.in

Burn-in-period for the Gibbs sampler

spacing

Spacing between the stored samples (to reduce correlation)

save.z

if 0 the function does not save z samples

save.beta

if 0 the function does not save β samples

save.theta

if 0 the function does not save θ samples

save.lp

if 0 the function does not save computed log posterior for iterations

Value

the Gibbs sampling output

See Also

Other Gibbs sampling methods: get_grid_neighbors, lda_acgs_hs, lda_fgs_hs, lda_fgs_st, lda_fgs


clintpgeorge/ldamcmc documentation built on Feb. 22, 2020, 12:39 p.m.