logisticFun: Logistic function

View source: R/sp.env.functions.R

logisticFunR Documentation

Logistic function

Description

A simple logistic function of the form

\frac{1}{{1 + e^{\frac{x - \beta}{\alpha}}}}

Usage

logisticFun(x, alpha, beta)

Arguments

x

a numeric value or vector

alpha

a numeric value or vector

beta

a numeric value or vector

Details

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.

Value

a numeric value or vector resulting from the function

Author(s)

Boris Leroy leroy.boris@gmail.com

Maintainer: Boris Leroy leroy.boris@gmail.com

See Also

linearFun, quadraticFun

Examples

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))

virtualspecies documentation built on Sept. 27, 2023, 1:06 a.m.