Info

此问题已关闭。 请重新打开它进行编辑或回答。

How to optimize a specific logistic type equation using 'fminunc' and quasi-newton algorithm ?

2 次查看(过去 30 天)
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.

回答(1 个)

Alan Weiss
Alan Weiss 2013-12-4
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

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by