Quadratic Programming
Quadratic Programming
Introduction
The objective function is arranged such that the vector q contains all of the
(singly-differentiated) linear terms and Q contains all of the (twice-
differentiated) quadratic terms.
Put more simply, Q is the Hessian matrix of the objective function and q is
its gradient.
The matrix equation Ax=a contains all of the linear equality constraints,
and Bx <= b are the linear inequality constraints
When there are only inequality constraints (Bx<= b), the Lagrangean is
Global solutions
If the objective function is convex, then any local minimum found is also
the sole global minimum.
To analyze the function’s convexity, one can compute its Hessian matrix
and verify that all eigenvalues are positive, or, equivalently,
one can verify that the matrix Q is positive definite.
This is a sufficient condition, meaning that it is not required
To be true in order for a local minimum to be the unique global minimum,
but will guarantee this property holds if true.
Example
KKT conditions
the eigenvectors of the symmetric matrix tells us the information about the gradient
direction of the function
first compute the eigenvectors and eigenvalues of the matrix
we draw the contour map of the function and mark the directions of the two eigenvectors
eigenvector with largest eigenvalue indicates the steepest gradient direction
eigenvector with smallest eigenvalue indicates the most gradual gradient direction
Karush-Kuhn-Tucker
Find the solution that minimizes f(x), as long as all equalities hi(x)=0 and
all inequalities gi(x)≤0 hold
Put the cost function as well as the constraints in a single minimization
problem, but multiply each equality constraint by a factor λi
and the inequality constraints by a factor μi (the KKT multipliers)
We would have m equalities and n inequalities. Hence the expression for the
optimization problem becomes:
where L(x,λ,μ) is the Lagrangian and depends also on λ and μ, which are vectors
of the multipliers
we find the roots of the gradient of the loss function with respect to x to
find the extremum of the function.
the constraints in the function will make x depend on λ and μ