SSlogis5 | R Documentation |
Self starter for a five-parameter logistic function.
logis5(x, asym1, asym2, xmid, iscal, theta)
SSlogis5(x, asym1, asym2, xmid, iscal, theta)
x |
input vector (x) |
asym1 |
asymptotic value for low values of x |
asym2 |
asymptotic value for high values of x |
xmid |
value of x at which y = (asym1 + asym2)/2 (only when theta = 1) |
iscal |
steepness of transition from asym1 to asym2 (inverse of the scale) |
theta |
asymmetry parameter, if it is equal to 1, this is the four parameter logistic |
The equation for this function is:
f(x) = asym2 + (asym1 - asym2)/(1 + exp(iscal * (log(x) - log(xmid))))^theta
This is known as the Richards' function or the log-logistic and it is described in Archontoulis and Miguez (2015) - (doi:10.2134/agronj2012.0506).
a numeric vector of the same length as x (time) containing parameter estimates for equation specified
logis5: vector of the same length as x (time) using the 5-parameter logistic
require(ggplot2)
set.seed(1234)
x <- seq(0, 2000, 100)
y <- logis5(x, 35, 10, 800, 5, 2) + rnorm(length(x), 0, 0.5)
dat <- data.frame(x = x, y = y)
fit <- nls(y ~ SSlogis5(x, asym1, asym2, xmid, iscal, theta), data = dat)
## plot
ggplot(data = dat, aes(x = x, y = y)) +
geom_point() +
geom_line(aes(y = fitted(fit)))
x <- seq(0, 2000)
y <- logis5(x, 30, 10, 800, 5, 2)
plot(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.