Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to optimize a specific logistic type equation using 'fminunc' and quasi-newton algorithm ?
조회 수: 3 (최근 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.
댓글 수: 0
답변 (1개)
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
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!