[R] question about constraint minimization
Jonathan P Daily
jdaily at usgs.gov
Fri Nov 19 21:19:19 CET 2010
Does ?constrOptim look as though it will handle your needs?
Jonathan P. Daily
Technician - USGS Leetown Science Center
11649 Leetown Road
Kearneysville WV, 25430
"Is the room still a room when its empty? Does the room,
the thing itself have purpose? Or do we, what's the word... imbue it."
- Jubal Early, Firefly
r-help-bounces at r-project.org wrote on 11/19/2010 02:51:46 PM:
> [image removed]
> [R] question about constraint minimization
> dhacademic at gmail.com
> 11/19/2010 03:15 PM
> Sent by:
> r-help-bounces at r-project.org
> I am a beginner of R. There is a question about constraint minimization.
> function, y=f(x1,x2,x3....x12), needs to be minimized. There are 3
> requirements for the minimization:
> (1) x2+x3+...+x12=1.5 (x1 is excluded);
> (2) x1=x3=x4;
> (3) x1, x3 and x5 are in the range of -1~0, respectively. The rest
> (x2, x4, x6, x7, ...., x12) are in the range of 0~1, respectively.
> The "optim" function is used. And part of my input is as follow, where
> "xx1r" represents the x12:
> There are two problems in this input. the "up" and "lo" only define a
> of -1~1 for x1 to x11, which can not meet the requirement (3). In
> there is not any constraint imposed on x12. I have no idea how to
> matrix that can impose different constraints on individual variables in
> function. Any suggestion is highly appreciated.
> View this message in context: http://r.789695.n4.nabble.com/
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help