optimization - using fmin
9 次查看(过去 30 天)
显示 更早的评论
have a non linear maximization problem in Matlab (Max utility):
A=(((V/I)-Epsilon_A_S)*S_Initial-Epsilon_A_c*Call_Price)*
(1+r)+Epsilon_A_S*S_A-(Gamma/2)*(Epsilon_A_S^2)*(Sigma_i^2)
B=(((V/I)-Epsilon_A_S)*S_Initial-Epsilon_A_c*Call_Price)*(1+r)+
(Epsilon_A_S+Epsilon_A_c)*S_A-(Gamma/2)*(Epsilon_A_S+Epsilon_A_c)^2*(Sigma_i^2)-
Epsilon_A_c*K
z=(K-S_A)/Sigma_i
Utility_A=-exp(-Gamma*A)*normcdf(z+Gamma*Epsilon_A_S*Sigma_i)
+-exp(-Gamma*B)*(1-normcdf(z+Gamma*(Epsilon_A_S+Epsilon_A_c)*Sigma_i))
I want to maximize utility function by finding: Epsilon_A_S, Epsilon_A_c
The constraints are:
Epsilon_A_S<=2
Epsilon_A_c>=-1
All the rest are parameters.
How do I do I set this problem in Matlab?
1 个评论
Rik
2018-5-16
Sent by email:
"Dear Rik, Thank you very much for helping me with fminseach problem, as I'm doing my first steps in matlab. I still having problem for finding this equilibrium (I cannot find a feasible solution while trying to get the results in this paper in figure 1: https://www.scirp.org/journal/PaperInformation.aspx?PaperID=74734 can you please help me with that? kind regards, Yossi"
The advice offered on this page is applicable here as well. I won't invest the time to read an academic paper outside my field just to help you write code. If you write a good description of what you want to implement, you can post your question on this forum. Make sure to include what you tried and what specifically is different from your intended result. Have a read here and here. It will greatly improve your chances of getting an answer.
采纳的回答
Rik
2018-5-10
7 个评论
Rik
2018-5-10
Because when Epsilon_A_S<=2 becomes false (so when the solver tries a non-valid solution), 1/(Epsilon_A_S<=2)-1 becomes inf. Because the solver tries to minimize the function value, this means that it will only ever find a non-valid solution when the cost function is inf everywhere. For solutions that do comply with the conditions, this extra part becomes 0, so it has no effect on the rest of the cost function.
更多回答(2 个)
Yossi
2018-5-13
2 个评论
Rik
2018-5-13
Is the pattern clear? You need to add the 1/(test)-1 with your additional constraint. I've added it in the lines below.
minimize_function=@(Epsilon_A_S,Epsilon_A_c)...
-Utility_A(Epsilon_A_S,Epsilon_A_c)+...
1/(Epsilon_A_S<=2)-1+...
1/(Epsilon_A_S>=-1)-1+...
1/(Epsilon_A_c>=-1)-1;
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!