quadprog
Builtin index · Signal processing
result = quadprog(H, f, [A], [b], [Aeq=], [beq=], [lb=], [ub=], [max_iter=])
Input: H, f, A, b, Aeq, beq, lb, ub, max_iter · Output: result
What it is
Convex quadratic programming: minimises 0.5 x'Hx + f'x subject to A x <= b, Aeq x = beq and lb <= x <= ub, with the same constraint conventions, bound defaults (-Inf/+Inf) and keyword-or-positional rules as linprog. H: a symmetric positive semidefinite N-by-N matrix; f: a length-N vector. Method: infeasibility is decided exactly first (the phase-I simplex of linprog), then unboundedness (a feasible direction in the null space of H along which the objective falls), then a Mehrotra predictor-corrector primal-dual interior-point method, and finally the active set it found is re-solved as an equality-constrained KKT system, so the answer is the exact vertex or face solution rather than an interior-point approximation (checked against -H\f, Nocedal and Wright's example 16.4 and a closed-form portfolio).
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = quadprog(H, f, [A], [b], [Aeq=], [beq=], [lb=], [ub=], [max_iter=]) | H matrixH: a symmetric positive semidefinite N-by-N matrix.f vectorf: a length-N vector.A optionalConvex quadratic programming: minimises 0.5 x'Hx + f'x subject to A x <= b, Aeq x = beq and lb <= x <= ub, with the same constraint conventions, bound defaults (-Inf/+Inf) and keyword-or-positional rules as linprog.b optionalConvex quadratic programming: minimises 0.5 x'Hx + f'x subject to A x <= b, Aeq x = beq and lb <= x <= ub, with the same constraint conventions, bound defaults (-Inf/+Inf) and keyword-or-positional rules as linprog.Aeq optionalConvex quadratic programming: minimises 0.5 x'Hx + f'x subject to A x <= b, Aeq x = beq and lb <= x <= ub, with the same constraint conventions, bound defaults (-Inf/+Inf) and keyword-or-positional rules as linprog.beq optionalConvex quadratic programming: minimises 0.5 x'Hx + f'x subject to A x <= b, Aeq x = beq and lb <= x <= ub, with the same constraint conventions, bound defaults (-Inf/+Inf) and keyword-or-positional rules as linprog.lb optionalConvex quadratic programming: minimises 0.5 x'Hx + f'x subject to A x <= b, Aeq x = beq and lb <= x <= ub, with the same constraint conventions, bound defaults (-Inf/+Inf) and keyword-or-positional rules as linprog.ub optionalConvex quadratic programming: minimises 0.5 x'Hx + f'x subject to A x <= b, Aeq x = beq and lb <= x <= ub, with the same constraint conventions, bound defaults (-Inf/+Inf) and keyword-or-positional rules as linprog.max_iter optionalnot documented yet | Model —kind "quadprog"status —"optimal", "infeasible", "unbounded" or "iteration_limit", with the same NaN/-Inf conventions as linprogiterations —interior-point iterations; 1 for a pure equality-constrained problem | Returns a Model (kind "quadprog") with x, fval, status ("optimal", "infeasible", "unbounded" or "iteration_limit", with the same NaN/-Inf conventions as linprog) and iterations (interior-point iterations; 1 for a pure equality-constrained problem). A singular H is fine as long as the problem is bounded. Errors: an H that is not symmetric (to 1e-8 relative; pass (H + H') / 2 if you mean the symmetric part), an H that is clearly indefinite (the message gives the smallest eigenvalue; non-convex problems are not supported), H and f of different sizes, NaN or Inf in any input, and the constraint errors listed under linprog. |
Examples
No documentation example calls this form yet. The Signal processing chapter is where one belongs.