讲调包. 主问题是个凸二次规划, 找包调的时候顺便调研了 SciPy 处理一般带约束优化问题的不同算法的适用场景 (官方文档里并没有写得很明白).
An optimization problem with a quadratic objective function and linear constraints is called a quadratic program (QP). Consider the following (convex) QP,
\[\begin{align*} \min_\beta & \quad \Vert Y - X\beta \Vert_2^2, \\ \text{subject to} & \quad \boldsymbol{1}_p'\beta = 1, \\ & \quad \beta \succeq 0, \end{align*}\]with
- an $n \times 1$ vector $Y$,
- an $n \times p$ matrix $X$, and
- a $p \times 1$ vector $\beta$.