rDPM: Sequentially generate draws from a Dirichlet process mixture model,
by showing step by step the iterations taken.
The plot is centered at 0, with x and y from -5 to 5.
The mixture draws the centres for clusters from a Normal distribution
with mean mu and standard deviation sigma_0
Additional to plotting the points, it also returns
the points sampled.
Description
Hit enter to keep drawing until max n or type "x" to exit.
Usage
rDPM(n, alpha, mu, sigma_0, sigma)
Arguments
n
Number of observations.
alpha
Alpha corresponding to GEM(alpha) used to draw the rho vector.
mu
Mean of the Normal distribution used to draw the clusters.
sigma_0
Standard deviation of the Normal distribution used
to draw the points around the cluster centre.
sigma
Standard deviation for cluster centers
Value
Returns the n observations sampled from the DPMM distribution.