I need to find a logistic curve that passes through three points exactly. This means I cannot do a best fit but rather must use simultaneous equations. Essentially this is used to model population growth. The equation that I need to fit my data to is:
$$ P=\frac{M}{be^{-kt}+1} $$
This was derived from the differential equation: $\frac{dP}{dt}=kP(M-P)$
When I attempt to find constants M (maximum population), b and k I end up getting a negative value for b and a value for M which is less than the original data set. This ends up creating some sort of weird hyperbola that does exactly fit my data though is not the necessary equation. From what I gather b, M and k must be positive to form a logistic equation. Here is the data:
t=0 -> P=3766124
t=1 -> P=4000687
t=2 -> P=4500789
This is what I end up getting:
M -> 3311478946607640967/945032999867
k -> -Log[(1883446144648/1055718570207)
b -> -(247632514983464541/3559111461591105508)
Please show how this logistic function can be fitted exactly since these values are wrong. Thanks!
Let $u = e^{-k}$ and $p_t$ be value of $P$ at $t = 0, 1, 2$. We have
$$ \begin{cases} \frac{M}{p_0} &= b + 1\\ \frac{M}{p_1} &= bu + 1\\ \frac{M}{p_2} &= bu^2 + 1\\ \end{cases} \implies \begin{cases} \frac{M}{p_1} - \frac{M}{p_0} &= b(u-1)\\ \frac{M}{p_2} - \frac{M}{p_1} &= bu(u-1)\\ \end{cases} \implies u = \frac{\frac{1}{p_2} - \frac{1}{p_1}}{\frac{1}{p_1} - \frac{1}{p_0}} $$ Substitute the value of $p_t$ in above expression, one find $$u = \frac{1883446144648}{1055718570207} \implies k = -\log\left(\frac{1883446144648}{1055718570207}\right)$$ This is the value of $k$ you get. Once we have $u$, solving the remaining $M$ and $b$ is routine linear algebra. In the end, one get the values of $M$ and $b$ you already get.