[R] Seeking optimal mixture
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Sep 26 15:46:05 CEST 2001
On Wed, 26 Sep 2001, Kari Ruohonen wrote:
> This is maybe not directly an R problem but I have used R to try to solve
> it so I think somebody may be able to help.
> I have a mixture model with three components and a quadratic Scheffe
> polynomial p1x1+p2x2+p3x3+p12x1x2+p13x1x3+p23x2x3 fitted to the response.
> Now I'd like to compute the mixture corresponding the maximum response.
> Model for Y1 has the parameters
> Solving a system of linear equations (solve(A,b)) of the partial derivates
> and putting a constraint of x1+x2+x3=1 with Lagrange's multiplier finds
> the mixture
> that produces the maximum response 130.378 within the experimental region.
> Now, my model for another response Y2 has the parameters
> Solving as above with the partial derivatives gives
> that produces Y2(max)=44.381. But this is not the maximum since e.g.
> produces 48.089 (but is not necessarily the maximum response).
> I have looked at optim() and wondered if I could use it somehow to solve
> my problem. However, I have not found a way to tell optim() about my sum
> constraint x1+x2+x3=1. All help is appreciated.
You can't. Optimizing over a simplex is a harder problem. *However* if I
understand you aright your objective is a quadratic function and so you
can use package quadprog on CRAN, which does handle general enough
BTW to Peter Dalgaard: it really is harder to handle general linear
inequality constraints than box constraints.
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
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