| SSgompertz | R Documentation |
Creates initial coefficient estimates for selfStart wrappers around
gompertz() and gompertz_left(), for use with stats::nls(). Both
wrappers use the same 4-parameter (A, B, xmid, slope) interface.
SSgompertz(t, A, B, xmid, slope)
SSgompertz_left(t, A, B, xmid, slope)
SSgompertz_left(t, A, B, xmid, slope)
t |
A numeric vector of the predictor variable (time). |
A |
A numeric parameter for the starting asymptote of the response variable. |
B |
A numeric parameter for the ending asymptote of the response variable. |
xmid |
A numeric parameter for the time at the inflection point (the
steepest point) of the curve, in units of the predictor variable |
slope |
A numeric parameter for the response rate |
Right-Gompertz: x ~ SSgompertz(t, A, B, xmid, slope)
Left-Gompertz: x ~ SSgompertz_left(t, A, B, xmid, slope)
Used by analyse_kinetics() with method = "sigmoidal" and
shape = "gompertz" or "gompertz_left". Starting estimates locate the
inflection from a smoothed first derivative. SSgompertz() masks
stats::SSgompertz().
Any parameter may be held constant by writing a value in place of its name
in the formula, e.g. x ~ SSgompertz(t, A = 0, B, xmid, slope) fixes the
starting asymptote at A = 0. Fixed parameters are excluded from
estimation and are not returned by stats::coef().
A numeric vector of predicted values the same length as the
predictor variable t.
gompertz(), gompertz_left(), analyse_kinetics(),
SSlogistic(), stats::nls(), stats::selfStart(),
stats::SSgompertz()
## create a Gompertz curve with random noise
set.seed(15)
t <- 1:60
x <- gompertz(t, A = 10, B = 100, xmid = 30, slope = 4) +
rnorm(length(t), 0, 2)
data <- data.frame(t, x)
model <- nls(x ~ SSgompertz(t, A, B, xmid, slope), data = data)
summary(model)
## fix the starting asymptote `A` at a known value
model_fixed <- nls(x ~ SSgompertz(t, A = 10, B, xmid, slope), data = data)
summary(model_fixed)
## left-Gompertz
set.seed(16)
x2 <- gompertz_left(t, A = 10, B = 100, xmid = 30, slope = 4) +
rnorm(length(t), 0, 2)
data2 <- data.frame(t, x = x2)
model_left <- nls(x ~ SSgompertz_left(t, A, B, xmid, slope), data = data2)
summary(model_left)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.