sigmoid: A sigmoidal function

View source: R/common_mathematical_functions.R

sigmoidR Documentation

A sigmoidal function

Description

This function evaluates a sigmoidal function.

Usage

sigmoid(x, x0, L, k)

Arguments

x

A numeric vector which defines the values at which the sigmoidal function will be evaluated.

x0

A numeric value which defines the x-value of the sigmoid's midpoint

L

A numeric value which defines expected change in f(x) above/below 0. For example, if L = 2, then the function will stretch ± 1 units above/below 0 at f(0) = 0.

k

A numeric value which affects the steepness of the function.

Value

A number or a numeric vector.

Author(s)

Edward Lavender

Examples


x <- 1:10
plot(x, sigmoid(x, 5, L = 5, k = 1), type = "b")
abline(h = 0, lty = 3)

x <- 0:20
plot(x, sigmoid(x, 5, L = 2, k = 1), type = "b")
abline(h = 0, lty = 3)

x <- -60:60
plot(x, sigmoid(x, 0, L = 2, k = 0.1), type = "b")
abline(h = 0, lty = 3)


edwardlavender/Tools4ETS documentation built on Nov. 29, 2022, 7:41 a.m.