MATLAB: Fitting a Custom Sigmoid

curve fittingsigmoid

Hello,
I have a set of data that decays in a sigmoidal fashion. I believe it should be a good fit to a function of the form shown in the first screenshot, but when I use the Custom Fit feature in the Curvefitting App matlab gives a -Rsq so something is clearly going wrong. I have attached a screenshot of the attempted fit and result as well. I would really appreciate any advice or input as to why this may not be working and alternatives I could try.
Thank you!

Best Answer

Hi,if the fitting function is:
1:y=a1*exp(-a2*exp(x))
Root of Mean Square Error (RMSE): 0.291990919479646
Sum of Squared Residual: 2.81353700293277
Correlation Coef. (R): 0.943693599341358
R-Square: 0.890557609437848
Adjusted R-Square: 0.883261450067038
Parameter Best Estimate
---------- -------------
a1 7.58840204504645
a2 1.16352684388827E-7
2:y=a1*exp(-a2*exp(x))+a3
Root of Mean Square Error (RMSE): 0.111213914229836
Sum of Squared Residual: 0.408161645704602
Correlation Coef. (R): 0.991993546182226
R-Square: 0.984051195667188
Adjusted R-Square: 0.982987942045001
Parameter Best Estimate
---------- -------------
a1 3.31691483854775
a2 6.92191293955397E-7
a3 4.93177045354278
3:y=a1*exp(-a2*exp(a4*x))+a3
Root of Mean Square Error (RMSE): 0.00643423581192002
Sum of Squared Residual: 0.001366179885952
Correlation Coef. (R): 0.999973308091645
R-Square: 0.999946616895747
Adjusted R-Square: 0.999943058022131
Parameter Best Estimate
---------- -------------
a1 2.46665608498939
a2 4.05630590375969E-12
a4 1.85195743324274
a3 5.25959927640292