maximizer of a function including integral
이전 댓글 표시
I want to get the maximizer of a function contain integral
function f = score(g)
g = [b0, b1, a];
integral = @(x) (exp(b0+b1*x)./(1+a*exp(b0+b1*x))).^yi.*(1./(1+a*exp(b0+b1*x))).^(1/a).*exp(-(x-mi).^2/(2*tau));
f = -log(quadl(integral, mi-5*sqrt(tau), mi+5*sqrt(tau)));
where yi and mi are given (the data), g is the variable I want to solve, x is the integration variable.
I used the function
fminsearch(@(g) score(g), g0)
to get the maximizer. However, the warning
...
In fminsearch at 320
...
Warning: Maximum function count exceeded; singularity likely.
keep popping out.
What can I do to check the program and improve it? The problem itself should be theoretically sound, but I'm not quite familiar with the numerical algorithm.
Thank you so much!!!
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!