[R] Many thanks. (Was: Supply linear constrain to optimizer)
Haifeng (Kevin) Xie
H.F.Xie at westminster.ac.uk
Mon Sep 17 22:14:36 CEST 2001
Many thanks to those took time replied to my question. They were very
helpful and I solved my problem by reparameterization. With the help of
optim() the fitting procedure is very robust and insensitive to initial
Once again, many thanks.
-------- Original post ---------
>Dear R and S users,
>I've been working on fitting finite mixture of negative exponential
>distributions using maximum likelihood based on the example given in
>MASS. So far I had much success in fitting two components. The problem
>started when I tried to extend the procedure to fit three components.
>likelihood = sum( ln(c1*exp(-x/lambda1)/lambda1 +
>c2*exp(-x/lambda2)/lambda2 + (1-c1-c2)*exp(-x/lambda3)/lambda3) )
>I've used optimizers such as ms and nlminb (SPLUS 5.0 for UNIX), and
>provided parameters constrains (0 <= c1, c2 <= 1) to nlminb via lower and
>upper. But these constrains provide no protection for (1-c1-c2) being
>between interval [0,1], which resulted in generating NAs in the
>likelihood function during iteration.
>I've been looking at various documentations, but didn't see anywhere
>mentioning setting linear constrain, in this case, c1 + c2 <= 1.
>Any suggestion and pointers will be greatly apprepciated.
>Cavendish School of Computer Science
>University of Westminster
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help