riccardo24
2012-Jan-02 11:36 UTC
[R] quadratic programming-maximization instead of minization
Hi, I need to maximize a quadratic function under constraints in R. For minimization I used solve.QP but for maximization it is not useful since the matrix D of the quadratic function should be positive definite hence I cannot simply change the sign. any suggestion ? thanks -- View this message in context: http://r.789695.n4.nabble.com/quadratic-programming-maximization-instead-of-minization-tp4253011p4253011.html Sent from the R help mailing list archive at Nabble.com.
Ken Hutchison
2012-Jan-02 21:02 UTC
[R] quadratic programming-maximization instead of minization
I don't have experience with this in R and I'm not sure I understand the question that well but maybe something like nearPD()? Ken Hutchison On Jan 2, 2012, at 6:36 AM, riccardo24 <riccardo.giacomelli at gmail.com> wrote:> Hi, I need to maximize a quadratic function under constraints in R. > For minimization I used solve.QP but for maximization it is not useful since > the matrix D of the quadratic function > should be positive definite hence I cannot simply change the sign. > > any suggestion ? > thanks > > -- > View this message in context: http://r.789695.n4.nabble.com/quadratic-programming-maximization-instead-of-minization-tp4253011p4253011.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > 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.
Tsjerk Wassenaar
2012-Jan-03 15:52 UTC
[R] quadratic programming-maximization instead of minization
Hi Riccardo, Would it be possible to use max(diag(D))*diag(ncol(D)) - D ? That also reverses the order of eigenvalues/-vectors. Cheers, Tsjerk On Jan 2, 2012 4:35 PM, "riccardo24" <riccardo.giacomelli@gmail.com> wrote: Hi, I need to maximize a quadratic function under constraints in R. For minimization I used solve.QP but for maximization it is not useful since the matrix D of the quadratic function should be positive definite hence I cannot simply change the sign. any suggestion ? thanks -- View this message in context: http://r.789695.n4.nabble.com/quadratic-programming-maximization-instead-of-minization-tp4253011p4253011.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list 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. [[alternative HTML version deleted]]