Description Usage Arguments Value Author(s) See Also Examples
The function returns the Maximum A Posteriori (MAP)
estimates of the component labels (membership indicator variables)
based on a damcmc_res
object (output from est_mix_damcmc
) or
a bdmcmc_res
object (output from est_mix_bdmcmc
) for the
chain corresponding to MAP number of components.
For examples see
http://faculty.missouri.edu/~micheasa/sppmix/sppmix_all_examples.html#GetMAPLabels
1 | GetMAPLabels(fit)
|
fit |
Object of class |
A vector with size equal to the number of points, containing the MAP estimators of the component labels (or membership indicator variables). This the most likely component we would classify a point in.
Jiaxun Chen
normmix
,
to_int_surf
,
rsppmix
,
est_mix_damcmc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | truemix <- normmix(ps=c(.4, .2,.4), mus=list(c(0.3, 0.3), c(.5,.5),c(0.7, 0.7)),
sigmas = list(.02*diag(2), .05*diag(2), .01*diag(2)))
intsurf=to_int_surf(truemix,lambda = 100, win = spatstat::square(1))
pp1 <- rsppmix(intsurf)
plot(pp1)
plot(pp1, mus = intsurf$mus)#plot the mixture means as well
#plot the points with different colors depending on the true component label
plot(pp1, colors = TRUE)
#plot the points with different colors depending on the estimated component label
fit <- est_mix_damcmc(pp1, 3)
est_comp <- GetMAPLabels(fit)
plot(pp1, estcomp = est_comp, colors = TRUE)
fitBD <- est_mix_bdmcmc(pp1, 5)
est_compBD <- GetMAPLabels(fitBD)
plot(pp1, estcomp = est_compBD, colors = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.