Fitting sigmoid to data

前端 未结 3 1648
后悔当初
后悔当初 2021-02-04 12:24

There are many curve fitting and interpolation tools like polyfit (or even this nice logfit toolbox I found here), but I can\'t seem to find anything that will fit a sigmo

3条回答
  •  执笔经年
    2021-02-04 13:11

    If you have the Statistics Toolbox installed, you can use nonlinear regression with nlinfit:

    sigfunc = @(A, x)(A(1) ./ (A(2) + exp(-x)));
    A0 = ones(size(A)); %// Initial values fed into the iterative algorithm
    A_fit = nlinfit(x, y, sigfunc, A0);
    

    Here sigfunc is just an example for a sigmoid function, and A is the vector of the fitting coefficients.

提交回复
热议问题