I have a lot of data, and I think it is possible to fit it to a sigmoid (this thought based on my eye-sight, not a mathematical formula).
How can I find the parametric form with statistically significant explanatory power of the best sigmoid for my data?
Thanks!
One great thing that you can do is to use the "Curve fitting" App in Matlab. you can find it in APPS, in "Math, statistics and optimization" section.
over there you can choose your x and y data and the function that you want to fit over them (you can enter custom equations such as sigmoid).
Then you can see the fitting results on a plot, also, fitting parameters are shown.
If you were satisfied with the results and you want to use them inside a code, simply hit the generate code under the File tab. you can see the details in this screenshot i took. after pressing the generate code button, matlab will create a fuction that will give the same result. what i like to do is just copy the parts i need in this case:
enter code here
[xData, yData] = prepareCurveData( x, y );
% Set up fittype and options.
ft = fittype( 'a/(1+exp(-b*x))', 'independent', 'x', 'dependent', 'y' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Display = 'Off';
opts.StartPoint = [0.957166948242946 0.485375648722841];
% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts );
as you can see matlab adds the necessary details and now you can access fitting parameters using fitresult. for example-> fitresult.a