Info
This question is closed. Reopen it to edit or answer.
How to optimize a specific logistic type equation using 'fminunc' and quasi-newton algorithm ?
3 views (last 30 days)
Show older comments
Hello, I have y (dependent variable) and x (independent variable) data and want to develop a logistic model in the form of y = ymax/(1+exp(b-k*x). I want to optimize the solution to get b and k value by writing a function and solving them using 'fminunc'.
The values are like: ydata = [1.5 1.8 2.1 2.5 2.65 2.75] with xdata = [1 3 5 7 10 20], ymax = max(ydata). I wrote following code: function f = glass(x,xdata, ydata) f = (2.06/(1+exp(x(1)-x(2)*xdata)))- ydata;
in command window: ydata = [1.5 1.8 2.1 2.5 2.65 2.75]; xdata = [1 3 5 7 10 20]; x0 = [0.5; 0.5]; F = @(x)glass(x,xdata, ydata); [x,fval] = fminunc(F,x0) but it fails every time and says too many input input argument. Also want to mention quasi-newton algorithm to optimize it. How could I solve this problem?
Any help is appreciating.
0 Comments
Answers (1)
Alan Weiss
on 4 Dec 2013
There is an example showing how to solve this type of problem with both fminunc and with other, more efficient solvers. Follow the example carefully (especially where it shows how to define the objective function).
Alan Weiss
MATLAB mathematical toolbox documentation
0 Comments
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!