Learn R Programming

fmx (version 0.1.2)

MaP: Maximum a Posteriori clustering

Description

..

Usage

MaP(x, dist, ...)

Value

Function MaP returns an integer

vector.

Arguments

x

numeric vector

dist

an fmx object

...

..

Examples

Run this code
x = rnorm(1e2L, sd = 2)
m = fmx('norm', mean = c(-1.5, 1.5), w = c(1, 2))
library(ggplot2)
ggplot() + geom_function(fun = dfmx, args = list(dist = m)) + 
  geom_point(mapping = aes(x = x, y = .05, color = factor(MaP(x, dist = m)))) + 
  labs(color = 'Maximum a Posteriori\nClustering')

Run the code above in your browser using DataLab