Using Neal's algorithm 4 or 8 depending on conjugacy the sampling procedure for a Dirichlet process is carried out.
Lists of both cluster parameters, weights and the sampled concentration values are included in the fitted dpObj
.
When update_prior
is set to TRUE
the parameters of the base measure are also updated.
Fit(dpObj, its, updatePrior = FALSE, progressBar = TRUE)
A Dirichlet Process object with the fitted cluster parameters and labels.
Initialised Dirichlet Process object
Number of iterations to use
Logical flag, defaults to FAlSE
. Set whether the parameters of the base measure are updated.
Logical flag indicating whether to display a progress bar.
Neal, R. M. (2000). Markov chain sampling methods for Dirichlet process mixture models. Journal of computational and graphical statistics, 9(2), 249-265.