[R] Maximum likelihood estimation of a mixture of two weibull distribution

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Jan 22 16:47:03 CET 2003


"Ivone Figueiredo" <ivonefig at ipimar.pt> writes:

> Hi,
> 
> I would like to estimate the parameters of a mixture of two Weibull
> distributions by the maximum likelihood method. Is it possible to do it with
> fitdist?

Yes (in principle at least). Just define your mixture density as
something like 

mixt <- function(x,p,sh1,sc1,sh2,sc2)
        p*dweibull(x,sh1,scale1)+
        (1-p)*dweibull(x,sh2,scale2)+

and apply fitdistr to that.
-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list