View source: R/sp.env.functions.R
logisticFun | R Documentation |
A simple logistic function of the form
\frac{1}{{1 + e^{\frac{x - \beta}{\alpha}}}}
logisticFun(x, alpha, beta)
x |
a numeric value or vector |
alpha |
a numeric value or vector |
beta |
a numeric value or vector |
The value of beta
determines the 'threshold' of the logistic curve
(i.e. the inflexion point).
The value of alpha
determines the slope of the curve (see examples):
alpha
very close to 0 will result in a threshold-like response.
Values of alpha
with the same order of magnitude as the range of
x
(e.g., the range ofx
/ 10) will result in a
logistic function.
alpha
very far from 0 will result in a linear function.
a numeric value or vector resulting from the function
Boris Leroy leroy.boris@gmail.com
Maintainer: Boris Leroy leroy.boris@gmail.com
linearFun
, quadraticFun
x <- 1:100
y <- logisticFun(x, alpha = -10, b = 50)
plot(y ~ x, type = "l")
# The effect of alpha:
y1 <- logisticFun(x, alpha = -0.01, b = 50)
y2 <- logisticFun(x, alpha = -10, b = 50)
y3 <- logisticFun(x, alpha = -1000, b = 50)
par(mfrow = c(1, 3))
plot(y1 ~ x, type = "l", main = expression(alpha %->% 0))
plot(y2 ~ x, type = "l", main = expression(alpha %~~% range(x)/10))
plot(y3 ~ x, type = "l", main = expression(alpha %->% infinity))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.