PosteriorClusters: Generate the posterior clusters of a Dirichlet Process

View source: R/posterior_clusters.R

PosteriorClustersR Documentation

Generate the posterior clusters of a Dirichlet Process

Description

Using the stick breaking representation the user can draw the posterior clusters and weights for a fitted Dirichlet Process. See also PosteriorFunction.

Usage

PosteriorClusters(dpobj, ind)

Arguments

dpobj

Fitted Dirichlet process

ind

Index for which the posterior will be drawn from. Defaults to the last iteration of the fit.

Value

A list with the weights and cluster parameters that form the posterior of the Dirichlet process.

Examples

y <- rnorm(10)
dp <- DirichletProcessGaussian(y)
dp <- Fit(dp, 5)
postClusters <- PosteriorClusters(dp)


dirichletprocess documentation built on Aug. 25, 2023, 5:19 p.m.