I am trying to fit a bivariate cluster model with X and Y. What I would like to do is discard (make not clustered / un-grouped) that are far from the cluster center (for example $\mu$ + 2*standard deviation) at each direction.
X2 <- c(rnorm(150, 10, 1),rnorm(50, 10, 5), rnorm(150, 25,1),
rnorm(50, 25, 20), rnorm(200,35,1), rnorm(200,80,1), rpois(50,30))
Y2 <- c(rnorm(800, 30, 2), rpois(50,30))
df <- cbind (X2, Y2)
plot(df, pch = 20, col = "gray40", ylim = c(15,45), xlim = c(-10, 90))
I am expecting 4 clusters here and I would like to group only those inside ellipse that has high probability (say with in $\mu$ + 2*standard deviation in both X and Y) and make rest un-grouped.
Here is what tried with mixture model:
require(mixtools)
out <- mvnormalmixEM(df, lambda = NULL, mu = NULL, sigma = NULL, k = 4,
arbmean = TRUE, arbvar = TRUE,
epsilon = 1e-08, maxit = 10000, verb = FALSE)
plot(out, density = TRUE, alpha = c(0.01, 0.05, 0.10, 0.12, 0.15),
marginal = TRUE)
I do not know how to put such threshold here.