How to solve a semi-definite programming with l1-norm objective?
12 views (last 30 days)
Show older comments
I am currently working on a problem related to a semi-definite programming (SDP) with l1-norm objective. After two-week survey in the literature, I still can't find a possible way to solve the following problem:
min_A -tr(A*C) + \lambda*||A-A0||
s.t. A>=0, tr(A)<=\gamma
where C and A0 are given nxn constant matrices, and \lambda is a coefficient term that balances the contribution. The goal is to find an nxn matrix A such that the objective function is minimized such that A is POSITIVE SEMI-DEFINITE and its trace is less than some threshold \gamma.
I wonder if there is any paper or solver that has handled this kind of problem. Thanks in advance if anyone could provide any clues.
0 Comments
Answers (1)
John D'Errico
on 10 Jan 2023
This is an optimization problem, but I would argue it has been posed poorly. If you want to constrain the matrix A to be positive semi-definite, then DON'T solve for the matrix A. Instead, solve for a Cholesky factor of A. So your unknowns will be a triangular matrix.
For example, suppose we want to solve a problem for the 3x3 matrix A, such that A is P.S.D.? I'll pick a semi-random problem. Then I'll solve it using a problem based formulation.
help optimproblem
% arbitrary numbers for lambda and the maximum trace of A.
trmax = 3;
lambda = 1;
C = rand(3);
A0 = rand(3); A0 = A0 + A0' + randn(size(A0))/100
eig(A0)
So A0 is not in fact truly PSD. But it is not terribly far off.
Now formulate the problem, combined with all constraints. The unknown will be a vector of
X = optimvar('X',[1,6])
prob = optimproblem('Description','PSD matrix problem');
% Sadly, squareform does not work here.
L = reshape([X(1),X(2),X(3),0,X(4),X(5),0,0,X(6)],[3,3]);
A = L*L';
prob.ObjectiveSense = 'minimize';
prob.Objective = -trace(A*C) + lambda*norm(A - A0,1); % 1-norm used
prob.Constraints.Aconstraint = -A <= 0;
prob.Constraints.tracelimit = trace(A) <= trmax;
X0.X = rand(1,6);
Xsol = solve(prob,X0)
How well did it do?
L = tril(ones(3));
L(find(L)) = Xsol.X;
The matrix L is lower triangular.
L
And so Asol was:
Asol = L*L'
trace(Asol)
So the trace of A lies at or near the upper limit for the trace.
Is Asol positive semi-definite? It must be so, because it was formed from a Cholesky product.
format long g
eig(Asol)
Sadly, this answer has been posted far too late to help @Vincent. But perhaps others may find it useful. I could have done it as easily without the problem formulation for an optimization, so just as a call to fmincon, but since I'm posting an answer in 2023, I might as well make my answer be one that uses the current capabilities of MATLAB.
0 Comments
See Also
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!