The Dual of Quadratic Programing (QP)
Explore the concept of the dual in quadratic programming problems within constrained optimization. Understand how the dual problem reduces complex primal constraints to simpler box constraints and how it can be solved using the projected gradient descent algorithm. Apply these concepts through an example using NumPy to solve investment allocation minimizing risk.
We'll cover the following...
The dual of a QP problem is also another QP problem but with simpler box constraints. Therefore, no matter how complex the primal constraints are, the dual of a QP problem will always have box constraints and can always be solved using the PGD algorithm.
Calculating the dual of the QP problem
Consider a QP problem with the primal objective given as follows:
where
The Lagrangian function is given by the following:
where
Note: The Lagrangian here is a convex function because it is a combination of quadratic and linear functions. Therefore, the local optimum is always the global optimal solution.
To find the dual objective