필터 지우기
필터 지우기

quadprog runs very slow on large problem involving l^1 norm

조회 수: 11 (최근 30일)
Ziyu Chen
Ziyu Chen 2020년 12월 30일
답변: Manas Shukla 2022년 2월 2일
Hi,
I want to find the minimum of the function with respect to vector x on matlab R2020b:
, where A is of size 500*3044, B is of size 101*3044. And my matlab code employing quadprog function is: (s_length = 3044)
f = [- A'*y - B'*z; lambda * ones(s_length,1)];
H = blkdiag(A'*A + B'*B,zeros(s_length));
A = [eye(s_length) -eye(s_length);
-eye(s_length) -eye(s_length)];
b = zeros(2*s_length,1);
Aeq = [];
beq = [];
lb = [];
ub = [];
x0 = [];
xopt = quadprog(H,f,A,b,Aeq,beq,lb,ub,x0);
But it turns out quadprog would spend several minutes to give an answer to this problem. Is there a more efficient way to solve this optimization problem? Thanks!

답변 (1개)

Manas Shukla
Manas Shukla 2022년 2월 2일
As per my understanding of the issue, it takes several minutes to execute the whole script which includes loading variables into MATLAB Workspace, the time it takes for matrix multiplication while defining variable “f”, and lastly amount of time to process the function “quadprog”. Here are few suggestions to overcome your issue:
  1. Since matrices used here are huge, if all the variables are pre-loaded into the MATLAB Workspace before calling the function “quadprog”, then it will reduce the execution time of the script.
  2. Providing a good initial starting point i.e., “x0”, the function “quadprog” will converge quickly as it is based on iterative interior-point algorithm.
  3. You can use “mpcActiveSetSolver” function alternatively which is available in MPC toolbox. The condition here is that matrix “H” must be positive definite matrix.

카테고리

Help CenterFile Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by