A simple function for obtaining \(f(x) = 1/(1+exp(-x))\).

sigmoid(x)

Arguments

x

numeric vector

Value

a numeric

Examples

sigmoid(c(-10, -1, 0, 1, 10))
#> [1] 4.539787e-05 2.689414e-01 5.000000e-01 7.310586e-01 9.999546e-01