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)
dpObj | Initialised Dirichlet Process object |
---|---|
its | Number of iterations to use |
updatePrior | Logical flag, defaults to |
progressBar | Logical flag indicating whether to display a progress bar. |
A Dirichlet Process object with the fitted cluster parameters and labels.
Neal, R. M. (2000). Markov chain sampling methods for Dirichlet process mixture models. Journal of computational and graphical statistics, 9(2), 249-265.