Regression of Irregular Exponential I am trying to model the population growth of countries with the following logistic equation:
$$p(t) = \frac{P_oK}{P_0+(K-P_0)e^{(-rt)}}\tag{displayed}$$
Where $p$ = population; $P_0$ = initial population; $K$ = carrying capacity; $r$ = constant; and $t$ = time
I have the data of the population over time and a set carrying capacity. But I would like to know how to go about performing a regression with this function to best fit the all the data I have available. 
Preface: I think I may be out of my depth here in the math required but I am very willing to try... and if nothing else it would at least satisfy my curiosity.
Thanks.
 A: You can conduct a linear regression. You just have to do some transformations. $$p(t) = \frac{P_oK}{P_0+(K-P_0)e^{-rt}}=\frac{K}{1+(\frac{K}{P_0}-1)e^{-rt}}$$
$$=\frac{1}{p(t)}=\frac{1+(\frac{K}{P_0}-1)e^{-rt}}{K}\Rightarrow \frac{1}{p(t)}=\frac{1}{K}+\frac{(\frac{K}{P_0}-1)e^{-rt}}{K}\Rightarrow \frac{1}{p(t)}-\frac{1}{K}=\frac{(\frac{K}{P_0}-1)e^{-rt}}{K}$$
$$\Rightarrow \frac{1}{p(t)}-\frac{1}{K}=\left( \frac{1}{P_0}-\frac{1}{K} \right) \cdot e^{-rt}$$
Taking logs
$$ln\left( \frac{1}{p(t)}-\frac{1}{K}\right) =rt+ln\left(\frac{1}{P_0}-\frac{1}{K}  \right)$$
Transforming the values
$y=ln\left( \frac{1}{p(t)}-\frac{1}{K}\right)$ and $b=ln\left(\frac{1}{P_0}-\frac{1}{K}  \right)$ 
It is possible to calculate the y-values, because you know p(t) for the corresponding t-value.
$y=r\cdot t+b$
A: This is a typical nonlinear regression problem where the parameters $K$ and $r$ must be identified.
As usual, the problem is to have "good" starting values. Assuming that your data cover a wide range, there are a few things which can help you to get estimates.
The slope at the origin is $$P_0'=\frac{{P_0}\, r \,(K-{P_0})}{K}$$ On the other hand, the inflection point occurs at $$t_*=\frac{\log \left(\frac{{K-P_0}}{{P_0}}\right)}{r}$$
Using these two informations (visual estimates), you can eliminate $r$ from the second equation and solve numerically the first for $K$. At this point, you are ready to go for the nonlinear regression.
Edit
At the inflection point, you also have $P(t_*)=\frac K2$ which can be very helpful for an estimate of $K$.
Now, assume that this value is correct and rewrite $$\log \left(\frac{P (K-{P_0})}{{P_0} (K-P)}\right)=rt$$ from which you can deduce $r$ using a linear regression with no intercept.
For sure, all of the above assume that the inflection point belong to the data.
