Minimum of function by vector parameters

조회 수: 5 (최근 30일)
terance
terance 2011년 5월 13일
[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
Andrew Newell
Andrew Newell 2011년 5월 13일
Do you have the Optimization Toolbox?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by