lda_fgs_lppv: Computes Log Posterior Predictive Value for an LDA model:

Description Usage Arguments Value See Also

View source: R/lda_fgs_lppv.R

Description

This is based on Zhe Chen (2015) [dissertation].

Usage

1
2
lda_fgs_lppv(K, V, wid, doc.N, alpha.v, eta, max.iter = 100, burn.in = 0,
  spacing = 1)

Arguments

K

Number of topics in the corpus

V

Vocabulary size

wid

a vector of vocabulary ids of every word instance in the corpus. Note: we assume vocabulary id starts with 1.

doc.N

a vector of word counts for each document in the corpus

alpha.v

hyperparameter vector for document Dirichlets θ

eta

hyperparameter value for topic Dirichlets β

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)

Value

A list that consists of (a) a (D x S) matrix of log posterior predictive values for each held-out using each sample, where S is the number of saved samples based on burn.in and spacing, and (b) log posterior predictive value of the corpus.

See Also

Other posterior predictive check (PPC) options: lda_acgs_lppv_R, lda_fgs_lppv_R


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