fitdecay2: Fit two phase exponential decay data.

Description Usage Arguments Value Examples

View source: R/fitdecay2.R

Description

Based on a two phase exponential decay model 'y=range1*exp(-k1*x)+range2*exp(-k2*x)' The fitting formula is: 'y ~range1*exp(-k1*x) + range2*exp(-k2*x) + ylo'

Usage

1
fitdecay2(x, y, data, k1, k2, range1, range2, ylo, weigh)

Arguments

x

is a vector of non-exponential linear scale values representing time.

y

is a vector of y values for x, usually responses.

data

is a dataframe with x and y.

k1

the first rate constant, expressed in reciprocal of the X axis time units. The first half-life is 0.6932/k1.

k2

the second rate constant, expressed in reciprocal of the X axis time units. The second half-life is 0.6932/k2.

range1

a single value for the range of y in the first phase of decay, in y units.

range2

a single value for the range of y in the second phase of decay, in y units.

ylo

the lowest y value, or the value at infinite times, expressed in the same units as Y.

weigh

chooses regression weighting by 1/y^2. Default = FALSE.

Value

nls

Examples

1
2
# fitdecay2(x=Time, y=Response, data=decay2ex, k1 = 1.5, k2 = 0.2,
# range1 = 2, range2 = 10, ylo=1, weigh=T)

TJMurphy/nlfitr documentation built on March 18, 2021, 12:33 p.m.