Re: [R] Nonlinear integer programming (again)

2015-02-16 Thread John Kane

You may have good reason to distrust the Excel solver :)

See below

John Kane
Kingston ON Canada


> -Original Message-
> From: rzw...@ets.org
> Sent: Sat, 14 Feb 2015 23:53:55 +
> To: r-help@r-project.org
> Subject: [R] Nonlinear integer programming (again)
>
> Oddly, Excel's Solver will produce a solution to such problems but (1) I
> don't trust it and (2) it cannot handle a large number of constraints.

>From IIRC a discussion on the R-help list but which I forgot to save the link.

"The idea that the Excel solver "has a good reputation for being fast and 
accurate" does not withstand an examination of the Excel solver's ability to 
solve the StRD nls test problems. Solver's ability is abysmal. 13 of 27 
"answers" have zero accurate digits, and three more have fewer than two 
accurate digits --and this is after tuning the solver to get a good answer.
...
Excel solver does have the virtue that it will always produce an answer, albeit 
one with zero accurate digits."
Bruce McCullough


FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your 
desktop!

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Nonlinear integer programming (again)

2015-02-16 Thread Hans W Borchers
Zwick, Rebecca J  ETS.ORG> writes:

> Oddly, Excel's Solver will produce a solution to such problems but
> (1) I don't trust it and
> (2) it cannot handle a large number of constraints.
> [...]
> My question is whether there is an R package that can handle this problem.


There are not many free integer (nonlinear) programming (IP, INLP)
solvers available. You could send your problem to one of the MINLP
solvers at NEOS:

http://neos.mcs.anl.gov/neos/solvers/

[See the list of relevant NEOS solvers (commercial and free) on this page:
 http://www.neos-guide.org/content/mixed-integer-nonlinear-programming]

You can also use the 'rneos' package to send your request to one of
these Web services, but most of the time I find it easier to directly
fill the solver template. Please note that you have to format your
problem and data according to the solver's needs, i.e. likely in AMLP
or GAMS syntax.

If you intend to solve such problems more often, I'd suggest to
download one of the commercial solvers with academic licenses (e.g.,
Knitro, Gurobi, ...) and to install a corresponding R package to
access the solver. For more information see the Optimization task
view.

I would *never* trust Excel for these kinds of problems...

By the way, I may not correctly understand your objective, but perhaps
you can formulate it as maximizing a quadratic function (with
constraints).

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Nonlinear integer programming (again)

2015-02-14 Thread Rich Shepard

On Sat, 14 Feb 2015, Zwick, Rebecca J wrote:


My question is whether there is an R package that can handle this problem.


Rebecca,

  I'm not sure, but have you looked at the Simplex method in the boot()
package?



Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Nonlinear integer programming (again)

2015-02-14 Thread Zwick, Rebecca J
Another user suggested I elaborate on my previous post, giving specifics of the 
problem I am trying to solve.  Here they are:



It is a selection problem involving sample weights.  Say we have applicants 
with test scores x.  The vector y indicates whether the applicant is a member 
of Group Y, which is relevant to selection.  The vector w contains the sample 
weights.  The vector z is to contain zeroes and ones indicating which 
applicants are selected.  I want to maximize the weighted average test score 
for the selected applicants, [1/(z'w)]*(z'diag(xw'), under the following 
constraints:



All elements of z are either 0 or 1.

Additional constraints are of the form

a �  z'w � b  and   z'diag(yw') � c,

where a, b, and c are positive constants.



The inequality constraints are linear in z, but the quantity to be maximized is 
not.

My question is whether there is an R package that can handle this problem.



PREVIOUS POST:

I am seeking an optimization routine that can deal with the following problem:

Maximize g(x), where x is a vector and g is nonlinear, subject to linear 
constraints of the form h(x)>0 and m(x)=0 and subject to the constraint that 
all values of x are 0 or 1.

I can't find a nonlinear optimization program in R that states that it can 
accommodate 0-1 constraints.

Oddly, Excel's Solver will produce a solution to such problems but (1) I don't 
trust it and (2) it cannot handle a large number of constraints.


Rebecca Zwick  (Santa Barbara, California)
Statistical Analysis, Data Analysis, and Psychometric Research
Educational Testing Service




This e-mail and any files transmitted with it may contain privileged or 
confidential information. It is solely for use by the individual for whom it is 
intended, even if addressed incorrectly. If you received this e-mail in error, 
please notify the sender; do not disclose, copy, distribute, or take any action 
in reliance on the contents of this information; and delete it from your 
system. Any other use of this e-mail is prohibited.


Thank you for your compliance.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.