[R] model based clustering with flexmix

Giovanni Luca Ciampaglia giovanni.luca.ciampaglia at usi.ch
Mon Nov 9 14:52:48 CET 2009


Hello all,
I am trying to fit a truncated mixture model and I wrote a driver for 
flexmix following the example in the vignette, but it doesn't work for 
me: it assigns all data points to one component only, e.g.:
> > source('bugged.R')
>
> Call:
> flexmix(formula = x ~ 1, k = 2, model = truncatedmodel(lower = -4,
>     upper = 4))
>
>        prior size post>0 ratio
> Comp.1 0.494    0   1000     0
> Comp.2 0.506 1000   1000     1
>
> 'log Lik.' -707703.3 (df=9)
> AIC: 1415425   BIC: 1415469

What am I doing wrong? Please find my code attached.

cheers

-- 
Giovanni L. Ciampaglia
PhD Student
University of Lugano, MACS Lab

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bugged.R
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091109/754891f4/attachment-0001.pl>


More information about the R-help mailing list