CVXOPT L1范数逼近ldB的非法值

2024-04-30 01:08:05 发布

您现在位置:Python中文网/ 问答频道 /正文

按照给定的L1范数近似的例子here,使用以下代码

from l1 import l1
from cvxopt import normal

m, n = 500, 100
P, q = normal(m,n), normal(m,1) 
u = l1(P,q)

一切正常。在

然而,当我将m改为小于n

^{pr2}$

我得到以下错误:

ValueError: illegal value of ldB

我可以看出,错误是由L1.py:180中的以下语句引起的:

lapack.gels(+P, uls)

再深入到lapack.c:3651,下面的语句抛出错误:

if (ldB < MAX(MAX(1,n),m)) err_ld("ldB");

然而,当我阅读CVXOPT's LAPACK interface for cvxopt.lapack.gels的文档时,它特别指出,当m小于n时,它解决了一个最小范数问题。在

有谁能解释一下为什么mn小不起作用?在


Tags: fromimport范数l1here错误语句max
1条回答
网友
1楼 · 发布于 2024-04-30 01:08:05

我也有同样的问题,为了子孙后代,我从CVXOPT问题中找到了一个答案。似乎l1函数是严格用于超定情况下近似| | Ax-b | | u 1的。我想“近似”应该是表示“过度确定”的关键词,但我并不清楚。不管怎样,马丁·安德森说:

Notice that the optimal value is zero when m < n and the equation Ax = b is consistent. This implies that any solution to the underdetermined system Ax = b is also a solution to the optimization problem. The l1 example code is intended for the case when m > n.

相关问题 更多 >