Minimum of function by vector parameters
5 次查看(过去 30 天)
显示 更早的评论
[EDIT: Fri May 13 15:01:56 UTC 2011 - Clarify - MKF]
Hello
I'd like to find the minimum of the following function
function y=probability_financial(a,b,w,pm,z)
% w=[w1,w2]
% a=[a1 a2]
% b=[b1 b2];
% z-matrix (2x2) is defined,
% pm = [pm1, pm2]-vector, is defined
y = abs(pm(1)-w(1)/(1+exp(-a(1)-b(1)*z(1,1)))-w(2)/...
(1+exp(-a(2)-b(2)*z(1,2))))+abs(pm(2)-w(1)/...
(1+exp(-a(1)-b(1)*z(2,1)))-w(2)/(1+exp(-a(2)-b(2)*z(2,2))));
end
by the following variables w=[w1,w2], a=[a1 a2] b=[b1 b2]
Would you be so kind to explain to me how to implement this?
Thanks for your answers!
回答(1 个)
Walter Roberson
2011-5-13
As you have an excess of unconstrained free variables, you can make some arbitrary choices and minimize exactly at those choices.
For example, Let
w(2) = 0
a(1) = arbitrary real value (does affect other variables)
a(2) = any real value (contribution will be ignored)
b(2) = any real value (contribution will be ignored)
Then
w(1) = pm(1)*exp((-a(1)*z(1,1)+a(1)*z(1,2)+ln(pm(2)/pm(1))*z(1,1))/(z(1,1)-z(1,2)))
b(1) = -ln(pm(2)/pm(1))/(z(1,1)-z(1,2))
will minimize to y = 0
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!