
Fit a single growth-curve model by nonlinear least squares
Source:R/growth_models.R
fit_growth_model.RdFits logistic_curve(), gompertz_curve() or richards_curve() to a
cumulative-incidence series by nonlinear least squares
(minpack.lm::nlsLM()), which is markedly more robust to the
identification issues of these S-shaped curves than base stats::nls().
Usage
fit_growth_model(
t,
y,
model = c("logistic", "gompertz", "richards"),
beta_fixed = 1.5,
start = NULL,
lower = NULL,
upper = NULL
)Arguments
- t
Numeric vector of time indices (
1, 2, ..., n, relative to the start of the fitting window).- y
Numeric vector of cumulative counts, same length as
t.- model
One of
"logistic","gompertz","richards".- beta_fixed
If not
NULL(Richards only), the shape parameter is held fixed at this value instead of estimated (improves convergence on short/fast-saturating phases, as used throughout the simulation study).- start
Optional named list overriding the default starting values
y0,K,gamma(andbetafor Richards).- lower, upper
Optional named lists overriding the default box constraints.