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

2 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Walter Roberson
Walter Roberson il 4 Ago 2021
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 Commenti
Walter Roberson
Walter Roberson il 4 Ago 2021

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.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Get Started with Optimization Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by