expoGrowth | R Documentation |
These functions provide the exponential growth function (expoGrowth), the exponential growth function with self-starter for the nls
function and the exponential growth function with self-starter for the drm
function in the drc package.
expoGrowth.fun(predictor, init, k) NLS.expoGrowth(predictor, init, k) DRC.expoGrowth(fixed = c(NA, NA), names = c("init", "k"), ...)
fixed |
numeric vector. Specifies which parameters are fixed and at what value they are fixed. NAs for parameter that are not fixed. |
names |
a vector of character strings giving the names of the parameters. The default is reasonable. |
The exponential growth is given by the following function:
f(x) = \textrm{init} \cdot \exp (k x )\}
expoGrowth.fun and NLS.expoGrowth return a numeric value, while DRC.expoGrowth returns a list containing the nonlinear function, the self starter function and the parameter names.
DRC.expoGrowth is for use with the function drm
.
Andrea Onofri
Ratkowsky, DA (1990) Handbook of nonlinear regression models. New York (USA): Marcel Dekker Inc.
Onofri, A. (2020). A collection of self-starters for nonlinear regression in R. See: https://www.statforbiology.com/2020/stat_nls_usefulfunctions/
rm(list=ls()) set.seed(1234) X <- 1:20 Ye <- 3 * exp(0.1 * X) Y <- Ye + rnorm(20, 0, 0.7) dataset <- data.frame(X, Y) rm(X, Y) model <- drm(Y ~ X, fct = DRC.expoGrowth(), data = dataset) model2 <- nls(Y ~ NLS.expoGrowth(X, a, b), data = dataset) summary(model) summary(model2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.