lda_fgs: Full Gibbs sampler (FGS) for LDA

Description Usage Arguments Value See Also

View source: R/lda_fgs.R

Description

This a R wrapper function for the C++ implementation of the full Gibbs sampler for LDA—a Markov chain on (z, β, θ).

Usage

1
2
lda_fgs(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_acgs, lda_fgs_hs, lda_fgs_st


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