user1783444
user1783444

Reputation: 121

solve.QP cannot maximize a positive definite quadratic function

I have an extremely simple quadratic problem that should in principle be solvable by solve.QP (quadprog):

max x^2+3*y^2 subject to x>=0, y>=0, x+y <=1

The problem is that turning the maximization into the required minimization, the matrix (obviously) becomes negative definite. It's not a problem related to small eigenvalues or roundoff.

I thought that solve.QP was a general solver, but despite my efforts in reading online material, it looks as if you cannot maximize a positive definite quadratic form over a compact domain (defined by linear constraints) using solve.QP.

Is that true?

I know that I can solve this and similar problems with other functions (constrOptim works fine), but I would have loved to have Lagrange multipliers attached to the maximizer.

Can you suggest any way to solve the above problem with (the very efficient) solve.QP, overcoming its asymmetric limitation related to positive definitness?

Upvotes: 1

Views: 1152

Answers (1)

Daniel Fischer
Daniel Fischer

Reputation: 183888

You want to find the maximum of a convex function on a convex domain. Convex functions cannot have a maximum in interior points of their domain, so a method using Lagrange multipliers cannot be applied to that problem.

In your case, the domain is a compact polygon, so the maximum is assumed in one of the vertices. That's a trivial check here.

Upvotes: 1

Related Questions