Problem: Find the "best fit" to (xn, yn) in the form y = K/(1+A exp(-r x))
Minimize E(K,A,r) = S {yn - K/(1+A exp(-r xn))}2
Solve for K, A and r from:
dE/dK =S {y - K/(1+A exp(-r x))} / (1+A exp(-r x)) = 0
dE/dA =S {y - K/(1+A exp(-r x))} exp(-rx) / (1+A exp(-r x))2 = 0
dE/dr =S {y - K/(1+A exp(-r x))} x exp(-rx) / (1+A exp(-r x))2 = 0
where, for convenience, we've dropped the "subscripts" n.
Mamma mia!