# Different classes for controlling the estimation of topic models

### Description

Classes to control the estimation of topic models which are inheriting
from the virtual base class `"TopicModelcontrol"`

.

### Objects from the Class

Objects can be created from named lists.

### Slots

Class `"TopicModelcontrol"`

contains

`seed`

:Object of class

`"integer"`

; used to set the seed in the external code for VEM estimation and to call`set.seed`

for Gibbs sampling. For Gibbs sampling it can also be set to`NA`

(default) to avoid changing the seed of the random number generator in the model fitting call.`verbose`

:Object of class

`"integer"`

. If a positive integer, then the progress is reported every`verbose`

iterations. If 0 (default), no output is generated during model fitting.`save`

:Object of class

`"integer"`

. If a positive integer the estimated model is saved all`verbose`

iterations. If 0 (default), no output is generated during model fitting.`prefix`

:Object of class

`"character"`

; path indicating where to save the intermediate results.`nstart`

:Object of class

`"integer"`

. Number of repeated random starts.`best`

:Object of class

`"logical"`

; if`TRUE`

only the model with the maximum (posterior) likelihood is returned, by default equals`TRUE`

.`keep`

:Object of class

`"integer"`

; if a positive integer, the log-likelihood is saved every`keep`

iterations.`estimate.beta`

:Object of class

`"logical"`

; controls if beta, the term distribution of the topics, is fixed, by default equals`TRUE`

.

Class `"VEMcontrol"`

contains

`var`

:Object of class

`"OPTcontrol"`

; controls the variational inference for a single document, by default`iter.max`

equals 500 and`tol`

10^-6.`em`

:Object of class

`"OPTcontrol"`

; controls the variational EM algorithm, by default`iter.max`

equals 1000 and`tol`

10^-4.`initialize`

:Object of class

`"character"`

; one of`"random"`

,`"seeded"`

and`"model"`

, by default equals`"random"`

.

Class `"LDAcontrol"`

extends class `"TopicModelcontrol"`

and
has the additional slots

`alpha`

:Object of class

`"numeric"`

; initial value for alpha.

Class `"LDA_VEMcontrol"`

extends classes
`"LDAcontrol"`

and `"VEMcontrol"`

and has the
additional slots

`estimate.alpha`

:Object of class

`"logical"`

; indicates if the parameter alpha is fixed a-priori or estimated, by default equals`TRUE`

.

Class `"LDA_Gibbscontrol"`

extends classes
`"LDAcontrol"`

and has the additional slots

`delta`

:Object of class

`"numeric"`

; initial value for delta, by default equals 0.1.`iter`

:Object of class

`"integer"`

; number of Gibbs iterations, by default equals 2000.`thin`

:Object of class

`"integer"`

; number of omitted in-between Gibbs iterations, by default equals`iter`

.`burnin`

:Object of class

`"integer"`

; number of omitted Gibbs iterations at beginning, by default equals 0.`burnin`

:Object of class

`"integer"`

; number of omitted Gibbs iterations at beginning, by default equals 0.`initialize`

:Object of class

`"character"`

; one of`"random"`

,`"beta"`

and`"z"`

, by default equals`"random"`

.

Class `"CTM_VEMcontrol"`

extends classes
`"TopicModelcontrol"`

and `"VEMcontrol"`

and has the
additional slots

`cg`

:Object of class

`"OPTcontrol"`

; controls the conjugate gradient iterations in fitting the variational mean and variance per document, by default`iter.max`

equals 500 and`tol`

10^-5.

Class `"OPTcontrol"`

contains

`iter.max`

:Object of class

`"integer"`

; maximum number of iterations.`tol`

:Object of class

`"numeric"`

; tolerance for convergence check.

### Author(s)

Bettina Gruen