Learn R Programming

statforbiology (version 0.9.9)

expoDecay: Exponential decay function

Description

These functions provide the exponential decay function (expoDecay), the exponential decay function with self-starter for the nls function and the exponential decay function with self-starter for the drm function in the drc package.

Usage

expoDecay.fun(predictor, C0, k)
  NLS.expoDecay(predictor, C0, k)
  DRC.expoDecay(fixed = c(NA, NA), names = c("C0", "k"))

Value

expoDecay.fun and NLS.expoDecay return a numeric value, while DRC.expoDecay returns a list containing the nonlinear function, the self starter function and the parameter names.

Arguments

predictor

a numeric vector of values at which to evaluate the model.

C0

model parameter

k

model parameter

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.

Author

Andrea Onofri

Details

The exponential decay is given by the following function: $$ f(x) = \textrm{C0} \cdot \exp (- k x )\}$$

References

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/

Examples

Run this code
data("degradation")
model <- drm(Conc ~ Time, fct = DRC.expoDecay(),
             data = degradation)
summary(model)
model2 <- nls(Conc ~ NLS.expoDecay(Time, a, b),
              data = degradation)
summary(model2)

Run the code above in your browser using DataLab