How to use linprog to maximize

조회 수: 6 (최근 30일)
ALI KARACA
ALI KARACA 2019년 11월 20일
답변: Shaunak 2025년 6월 10일
I am trying to maximiza :
expected insurance profit: p - πX where p is premium, π is probability (0,1) and X (cover)amount of monet has been paid by insurance firm to consumer for loss
W1 = Wo - e - p (no loss) where e is effort of consumer to avoid from accident and Wo initial wealth of consumer
W2 = Wo - e - p - l + X (with loss) where l is loss of consumer and U(W)=ln(W)
subject to (expected utility of consumer) : (1-π)U(W1)+πU(W2)
(1-π)U(Wo - e - p) + (π)U( Wo - e - p - l + X) ≤ Uh where U means utility and Uh is the highest utility consumer can get.
How I can write this maximization problem in matlab?
Thank you

답변 (1개)

Shaunak
Shaunak 2025년 6월 10일
It is my understanding that you want to solve an insurance profit maximization problem with consumer utility constraints in MATLAB.
You cannot use 'linprog' for this problem because the constraint contains logarithmic utility functions, making it nonlinear. The function 'linprog' only handles linear programming problems where all constraints must be of the form Ax ≤ b.
However, you can use MATLAB's 'fmincon' function for constrained nonlinear optimization. Since 'fmincon' minimizes functions, you need to negate your profit function for maximization as shown below:
% Objective: maximize p - π*X (negative for minimization)
objective = @(x) -(x(1) - pi * x(2));
You can now minimize the function using 'fmincon'. For further reference on maximizing with 'fmincon' to find the maximum profit, refer to this MATLAB Answers thread: https://www.mathworks.com/matlabcentral/answers/866545-maximize-objective-function-using-fmincon-with-a-limit
For more information on the 'fmincon' function, please refer to the MathWorks documentation of 'fmincon' function linked below: https://www.mathworks.com/help/optim/ug/fmincon.html
Hope this helps!

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by