How to optimize when the objective can be negatively influenced

1 回表示 (過去 30 日間)
Michael Hesse
Michael Hesse 2023 年 1 月 10 日
コメント済み: Torsten 2023 年 1 月 11 日
Hello, I want to solve an optimization problem:
x* = arg max_x f(x; c) for any c (where x and c are real numbers)
f is some kind of utility function and c can be set in such a way that it describes a worst case scenario
How can I solve such a problem with matlab?

回答 (2 件)

John D'Errico
John D'Errico 2023 年 1 月 10 日
This is just an optimization problem. Use any appropriate optimization solver. Note that the optimizers are typically minimizers, but that just means you will minimize -f(x). As far as the parameter c is concerned, are you looking to find a solution that is parametric as a function of c? Do you want to see a formula, as a function of c? For example,
syms x c
f = -x^2 + c*x;
The maximum is a simple to solve problem of course. It lies at the point x==c/2. We can find that by differentiating and setting the result to zero.
solve(diff(f,x) == 0,x)
ans = 
Of course, many far more complex problems will not have a simple solution like this. So you might decide to formulate the problem in terms of a solver.
fun = @(x,c) -x.^2 + c*x;
xmax = @(c) fminsearch(@(x) -fun(x,c),1);
Now you can solve for the max for any given numerical value of c.
xmax(3)
ans = 1.5000
If these cases are not what you are thinking about, then you need to be far less vague in terms of your real problem.

Michael Hesse
Michael Hesse 2023 年 1 月 11 日
編集済み: Michael Hesse 2023 年 1 月 11 日
Hello John, thank you for your response. I guess I have to reformulate my problem.
x* = arg max_x min_c f(x, c), where x and c are vectors.
I guess the symbolic solution to this problem is to solve the inner optimization problem by setting it's gradient with respect to c to zero and solve for c and then solve the outer optimization problem, right? Let's say this approach is not applicable, how can I solve such a problem numerically within matlab?
  3 件のコメント
Michael Hesse
Michael Hesse 2023 年 1 月 11 日
編集済み: Michael Hesse 2023 年 1 月 11 日
Probably, but not feasible if c is high dimensional and we have to discretize f(x, c_i) = F_i with a fine grid.
Torsten
Torsten 2023 年 1 月 11 日
That's the numerical method ready-made for your problem.
If you think it's not feasible for your problem, you will have to program a better solution or search elsewhere in numerical libraries.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by