MATLAB: How to solve this function below

solve function

parameters:a b c
KNOWN:(x1,y1),(x2,y2)… …(xn,yn) How can I figure out all the parameters by using MATLAB?

Best Answer

Your code was fine, but your variables were pretty badly scaled, so I think the fit was behaving badly numerically. Here is some code where I rescaled your time variable for the fit (and then rescaled it back to display):
TIME_SCALE = 1000;
time = [1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 ];
time = time/TIME_SCALE;
Y6711 = [0.001549451 0.001406211 0.001811241 0.001661079 0.002009743 0.001669221 0.002511118 0.001794201 0.003740947 0.00441657 0.004941945 0.004628348 0.004379816 0.005177686 0.004069535 0.004633793 0.007670759 0.009623098 0.009783128 0.010096395 0.012705525];
beta=nlinfit(time,Y6711,@curvefun,[0.5 0.5 0.5]);
a = beta(1);
b = beta(2);
c = beta(3);
%test the model
xx = min(time):(1/TIME_SCALE):max(time);
yy = a./(1+exp(b.*time+c));
plot(TIME_SCALE*time,Y6711,'o',TIME_SCALE*xx,yy,'r')
You are right that the initial guess is subjective. It is best to put in something that is approximately the right magnitude and sign if you can. For example, you know your parameter b has to be negative. But MATLAB figured it out here.