N.Alberts at roehampton.ac.uk
2012-Mar-05 10:57 UTC
[R] Fitting & evaluating mixture of two Weibull distributions
Hello, I would like to fit a mixture of two Weibull distributions to my data, estimate the model parameters, and compare the fit of the model to that of a single Weibull distribution. I have used the mix() function in the 'mixdist' package to fit the mixed distribution, and have got the parameter estimates, however, I have not been able to get the log-likelihood for the fit of this model in order to compare it to the single distribution. I have also had a look at the 'Mixtools' and 'Flexmix' packages. With both of these it is possible to fit a mixture of distributions, but, as far as I can tell, these are pre-defined and do not have a function for a mixture of two Weibull distributions. I have used the 'fitdistrplus' package to fit the single distribution. Does anyone have any suggestions either for getting the log-likelihood for models fitted with the mix() function, or other packages / functions which allow me to fit a double Weibull and get the log-likelihood for the model? Any suggestions are much appreciated! Best wishes, Nienke ---------------------------------------------------------------------------------------------- Nienke Alberts PhD Candidate Centre of Research in Evolutionary & Environmental Anthropology University of Roehampton Consider the environment. Please don't print this e-mail unless you really need to. This email and any attachments are confidential and inte...{{dropped:21}}
The contribution of each observation to the logliklihood is log(p*f1(x) + (1-p)*f2(x)) where f1 and f2 are the two density functions. Just sum. The standard likelihood ratio test is problematic here, as there are two parametrizations that reduce the mixture model to a single component: p=1 vs p < 1 plus the shape and scale parameters of the two components are identical. albyn On 3/5/12 2:57 AM, N.Alberts at roehampton.ac.uk wrote:> Hello, > > I would like to fit a mixture of two Weibull distributions to my > data, estimate the model parameters, and compare the fit of the model > to that of a single Weibull distribution. > > I have used the mix() function in the 'mixdist' package to fit the > mixed distribution, and have got the parameter estimates, however, I > have not been able to get the log-likelihood for the fit of this > model > in order to compare it to the single distribution. > I have also had a look at the 'Mixtools' and 'Flexmix' packages. With > both of these it is possible to fit a mixture of distributions, but, > as far as I can tell, these are pre-defined and do not have a > function > for a mixture of two Weibull distributions. > I have used the 'fitdistrplus' package to fit the single > distribution. > > Does anyone have any suggestions either for getting the > log-likelihood for models fitted with the mix() function, or other > packages / functions which allow me to fit a double Weibull and get > the log-likelihood for the model? > > Any suggestions are much appreciated! > > Best wishes, > > Nienke > > > > ---------------------------------------------------------------------------------------------- > Nienke Alberts > PhD Candidate > Centre of Research in Evolutionary & Environmental Anthropology > University of Roehampton > > > Consider the environment. Please don't print this e-mail unless you > really need to. > > This email and any attachments are confidential and > inte...{{dropped:21}} > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Apparently Analagous Threads
- finite mixture model (2-component Weibull): plotting Weibull components?
- Optimization failed in fitting mixture 3-parameter Weibull distri bution using fitdistr()
- Fitting weibull, exponential and lognormal distributions to left-truncated data.
- Comparison of two weibull distributions
- Fitting weibull and exponential distributions to left censoring data