richards {richards}R Documentation

Richards functions: Five parameter (5PL) logistic curves

Description

The Richards function, the inverse of the function, and the derivative of richards(x) (and the derivative of richards(x) with respect to log(x) in the point x, that is derivative of richards(exp(u)) with respect to u in the point x = exp(u)).

In other implementation of Richards functions and four parameter logistic functions the argument is log(x) of the here used argument x.

Here we have a positive concentration in mind, where value depending on the concentration can be described by Richards functions in the logarithm of the concentration.

Usage

        richards(x, a = 0.1, d = 2.4,
                 e = solveE(x50, b, ny), x50 = 100,
                 b = solveB(x = x50, a = a, d = d, ny = ny, 
                            x50 = x50, b4 = b4), b4 = 1,
                 ny = k - 1, k = 2)

  richards.deriv(x, a = 0.1, d = 2.4,
                 e = solveE(x50, b, ny), x50 = 100,
                 b = solveB(x = x50, a = a, d = d, ny = ny, 
                            x50 = x50, b4 = b4), b4 = 1,
                 ny = k - 1, k = 2)

richards.deriv.x(x, a = 0.1, d = 2.4,
                 e = solveE(x50, b, ny), x50 = 100,
                 b = solveB(x = x50, a = a, d = d, ny = ny, 
                            x50 = x50, b4 = b4), b4 = 1,
                 ny = k - 1, k = 2)

    richards.inv(y, a = 0.1, d = 2.4,
                 e = solveE(x50, b, ny), x50 = 100,
                 b = solveB(x = x50, a = a, d = d, ny = ny, 
                            x50 = x50, b4 = b4), b4 = 1,
                 ny = k - 1, k = 2)

solveE(x50, b, ny = k - 1, k = 2)

solveB(x = x50, a = 0.1, d = 2.4, x50 = 100, b4 = 1, ny = k - 1, k = 2)

Arguments

x a numeric vector of values at which to evaluate the function.
y a numeric vector of values at which to evaluate the function.
a a numeric parameter representing the horizontal asymptote on the left side (very small values of input) for b positive, else the horizontal asymptote on the right side: Zero concentration responce.
d a numeric parameter representing the horizontal asymptote on the right side (very large values of input) for b positive, else the horizontal asymptote on the left side: Infinite concentration responce.
b a numeric (reciprocal) scale parameter on the input axis, 'growth rate': slope factor. (The 'growth' parameter b should be negative, and a is thus the right side (larger) asymptote, for Bertalenffy models.)
x50 a numeric parameter representing the input value at the center of the curve: IC_50. The value of the Richards function will be midway between a and d at x50.
e a parameter determine the input value at the inflection point of the curve.
ny a numeric shape parameter that affects near which asymptote maximum 'growth' occurs.
k an alternative numeric parameter for ny. (The m of Richards (1959) is k with ny = k - 1.)
b4 a numeric parameter giving the (reciprocal) scale parameter of the four parameter logistic curve with slope as the 'richards' function at x50, and same asymptotes.

Details

richards(x) computes d + (a - d)/z^(1/ny) with z = (1 + ny * (x/e)^b) = (1 + (2^ny-1) * (x/x50)^b) for ny different from 0.

For ny equal to 0 the limiting Gompertz curve d + (a - d) * exp(-z) with z = (x/e)^b is found.

solveE converts the parameter x50 into the parameter e, the inflection point of the curve: e = x50/((2^(ny) - 1)/ny)^(1/b). By (2^ny-1) * (x/x50)^b = ny * (x/e)^b = ny * exp(b * (log(x)-log(e))) we recognize the notation of, e.g., Yin et al., 2003, and also see, how these parameters of the above Richards function relates to the parameters 'xmid' (log(x50)) and 'scal' (1/b) of SSfpl for ny equal 1 and the argument input the logarithm of x, log(x).

solveB finds the parameter b for the Richard curve such that the slope of the Richard curve is the same as the slope of the four parameter logistic curve with parameter b4 at x (where the asymptotes a and d (and location x50) of the two curves are identical).

See SSny1 for some examples on the same value found by different functions.

We observe that to compute z^(1/ny) = (1 + (2^ny-1)*(x/x50)^b)^(1/ny) for some values of ny the mantis z = 1 + (2^ny-1)*(x/x50)^b should be positive. For ny > 0 this is always the case (since x and x50 are positive). For ny < 0 the power function is undefined for z negative, unless 1/ny is an integer. The here given Richards function will for ny < 0 and 1/ny an even integer have a local extreme at the asymptote d, the right hand side asymptote (b positive), and will for ny < 0 and 1/ny an odd integer just pass d for infinity.

Value

A vector with function values.

Author(s)

Jens Henrik Badsberg

References

Richards, F.J. 1959: A flexible growth function for empirical use. J. Exp. Bot. 10: 290-300.

Xinyou Yin, Jan Goudriaan, Egbert A. Lantinga, Jan Vos And Huub J. Spiertz: A Flexible Sigmoid Function of Determinate Growth. 2003; Annals of Botany 91: 361-371.

Gottschalk, Paul G., Dunn, John R.: The five-parameter logistic: a characterization and comparison with the four-parameter logistic. 2005; Anal Biochem. Aug 1;343:54-65.

Examples

demo(showNy)

par(mfrow = c(1, 2))

# pdf("Relevant.pdf")

richardsLines
backFitFpl
relevant()

derivatives
derivatives(xlim = c(0.5, 20000), ylim = c(0, 0.1), ylim.x = c(0, 1.2), f = 4)

par(mfrow = c(2, 4))

# pdf("All.pdf")

# pdf("BelowE.pdf")
belowE(outer = FALSE, line = 1)

# pdf("Extra.pdf")
extra(outer = FALSE, line = 1)

# pdf("Below.pdf")
below(outer = FALSE, line = 1)

# pdf("Above.pdf")
above(outer = FALSE, line = 1)

for (i in 2:16) print(richards(10000, ny = -1/i))

[Package richards version 0.5.0 Index]