maximizer of a function including integral
Mostrar comentarios más antiguos
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!!!
Respuestas (0)
Categorías
Más información sobre Numerical Integration and Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!