How to define an objective function that maximize one thing and minimize the other at the same time?

2 次查看(过去 30 天)
I want to define an objective function that maximize the determinant and minimize the rank at the same time.
A=rand(5);
B=rand(5);
X=A+k*B;
maximize @(k) det(X)
minimize @(k) rank(X)
Is there anyway to joint both in one way?

采纳的回答

Walter Roberson
Walter Roberson 2021-8-4
Any matrix that does not have full rank will have a determinant of 0. If there is a k in range that makes X have rank less than maximum then the determinant for that will be 0.
It can make sense to look for the smallest rank that k can drive X but all such cases will have det 0, and any full rank matrix with positive det would have larger det. That is an incompatible goal with low rank.
Exception: it is hypothetically possible that det(X) is negative for all k that do not drive X singular. In such a case both goals can be realized by looking for the k that generates the lowest rank, since det 0 would be greater than any negative det.
But I doubt that situation applies in practice.
  3 个评论
Walter Roberson
Walter Roberson 2021-8-4

You use gamultiobj() and look for Pareto fronts. You cannot combine two objectives with fminsearch, fmincon, ga, simulated annealing, patternsearch, or surrogate optimization.

However: for some situations it can make sense to take two objectives and weight them to create a biased combined single objective that is then the thing that is what is optimized.

For example hypothetically you could calculate

det(C) - rank(C) 

and maximize. It probably is not a good weighting though.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multiobjective Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by