Learn R Programming

OptimModel (version 2.0-1)

exp_decay: Three-parameter exponential decay, gradient, starting values, and back-calculation functions

Description

Three-parameter exponential decay, gradient, starting values, and back-calculation functions.

Usage

exp_decay(theta, x)

Value

Let N = length(x). Then

  • exp_decay(theta, x) returns a numeric vector of length N.

  • attr(exp_decay, "gradient")(theta, x) returns an N x 3 matrix.

  • attr(exp_decay, "start")(x, y) returns a numeric vector of length 3 with starting values for (A, B, k).

  • attr(exp_decay, "backsolve")(theta, y) returns a numeric vector of length=length(y).

Arguments

theta

Vector of three parameters: (A, B, k). See details.

x

Vector of concentrations.

Author

Steven Novick

Details

The three-parameter exponential decay model is given by:

$$y = A + B \times \exp(-Kx).$$

The parameter vector is (A, B, k) where \(A =\min y\) ( minimum y value), \(A + B = \max y\) (maximum y value), and \(K = \exp(k)\) whichi is the shape parameter.

See Also

optim_fit, rout_fitter

Examples

Run this code
set.seed(123L)
x = 2^(-4:4)
theta = c(25, 75, log(3))
y = exp_decay(theta, x)  + rnorm( length(x), mean=0, sd=1 )
attr(exp_decay, "gradient")(theta, x)
attr(exp_decay, "start")(x, y)
attr(exp_decay, "backsolve")(theta, 38)

Run the code above in your browser using DataLab