I am looking at how a disease spreads through a population. I was given these initial cumulative cases (as the disease spreads):($8, 11, 15, 20 ,28, 38$)
I need to use the logistic growth recursive equation $n(t+1)=(-\frac{b}{N} \cdot n(t)+1+b) \cdot n(t)$ where $N=87$ and I need to estimate the value of b using least squares minimization.
I cannot figure out how to do it in matlab and have been trying for hours. If anyone could show me how to come up with an actual answer it would be wonderful, since i am totally stuck.
Having a look here, you will see that the continuous version of the logistic equation (a model of population growth) write $$\frac{dN}{dt}=\frac{r N(K-N)}{K}$$ and defining $x=\frac N K$, this reduces to $$\frac{dx}{dt}=r x(1-x)$$ If you separate variables $$dt=\frac {dx}{rx(1-x)}$$ and integrating (using partial fraction decomposition)$$\int_{0}^{\tau}dt=\int\frac {dx}{rx(1-x)}\implies \tau=\frac 1r\, \log\left(\frac x {1-x} \right)$$ So, defining $\alpha=\frac 1r$, the model has been linearized as $$\tau=\alpha\, \log\left(\frac x {1-x} \right)$$ which is quite simple to fit.
But take care : this is only an estimate (since what is measured is $x_i$ and not $\log\left(\frac {x_i} {1-x_i} \right)$) and, if you want to be rigorous, you should continue using a nonlinear regression for the model $$x=\frac{1 }{1+k \,e^{-r \tau }}$$