Re: [R] Three-component Negative Binomial Mixture: R code

2016-11-10 Thread Achim Zeileis
On Thu, 10 Nov 2016, danilo.car...@uniparthenope.it wrote: Thank you for your hints, now the goodness of fit test provides me good results, but surprisingly for me the three-component model turns out to be worse than the two-component one (indeed, I focused on the three-component mixture becau

Re: [R] Three-component Negative Binomial Mixture: R code

2016-11-10 Thread danilo . carita
Thank you for your hints, now the goodness of fit test provides me good results, but surprisingly for me the three-component model turns out to be worse than the two-component one (indeed, I focused on the three-component mixture because the two-component one exhibits a low p-value). In a

Re: [R] Three-component Negative Binomial Mixture: R code

2016-11-08 Thread Achim Zeileis
On Tue, 8 Nov 2016, danilo.car...@uniparthenope.it wrote: I tried the function flexmix() with the driver FLXMRnegbin() with two components first, in order to compare its results with those provided by my function mixnbinom(). In particular, I ran the following code: fm0 <- flexmix(y ~ 1, da

Re: [R] Three-component Negative Binomial Mixture: R code

2016-11-08 Thread danilo . carita
I tried the function flexmix() with the driver FLXMRnegbin() with two components first, in order to compare its results with those provided by my function mixnbinom(). In particular, I ran the following code: fm0 <- flexmix(y ~ 1, data = data.frame(y), k = 2, model = FLXMRnegbin()) where

Re: [R] Three-component Negative Binomial Mixture: R code

2016-11-07 Thread Achim Zeileis
On Mon, 7 Nov 2016, danilo.car...@uniparthenope.it wrote: I need a function for R software which computes a mixture of Negative Binomial distributions with at least three components. The package "countreg" on R-Forge provides a driver FLXMRnegbin() that can be combined with the "flexmix" pack

Re: [R] Three-component Negative Binomial Mixture: R code

2016-11-07 Thread Bert Gunter
Opinion only (and therefore ignorable): Unless you have a lot (?) of data, fitting such a model successfully is likely to be very challenging. I suggest that you consult a local statistical expert to see if you might take a different approach. On Mon, Nov 7, 2016 at 4:42 AM, wrote: > I need a

[R] Three-component Negative Binomial Mixture: R code

2016-11-07 Thread danilo . carita
I need a function for R software which computes a mixture of Negative Binomial distributions with at least three components. I found on another site the following function "mixnbinom". It works very well, but it computes a mixture of only two components: mixnbinom=function(y,k1,mu1,k2,mu2,prob