Exponential model fitting
Let an exponential model Nt=N0*exp(r*t) be fitted. What are the different solutions taking into account different hidden hypotheses: There are several ways to generate the data and depending the way the data are generated, different model should be used. t <- 11:110 N0 <- 100 r <- 0.05 Error proportional of N(t); if the constant of proportionality (here 0.2) is not too large the probability to have negative value is low y <- N0*exp(t*r) set.seed(1) Nt <- rnorm(100, mean=y, sd=0.2*y) df <- data.frame(t=t, Nt=Nt) Note that the error is not independent on the mean: heteroskedasticity ggplot(data = df, aes(x = .data[["t"]], y = .data[["Nt"]])) + geom_line() +theme_bw() Note that in log scale, the error is constant ggplot(data = df, aes(x = .data[["t"]], y = log(.data[["Nt"]]))) + geom_line() +theme_bw() Or...