Compute a sigmoid function.
sigmoid(x, asym = 1, v = 1)
Arguments
- x
a numerical vector, time points.
- asym
a numerical value (optional), the asymptote of the sigmoid function.
- v
a numerical value (optional), related to the slope at the origin.
Value
a numerical vector.
Details
see the function sim_x
.
Examples
## Test 1 :
x <- seq(-7,7,0.1)
y <- sigmoid(x)
plot(x,y,type="l",main="Sigmoid function")
## Test 2 :
x <- seq(-7,7,0.1)
y <- sigmoid(x)
y2 <- sigmoid(x,asym=0.5)
y3 <- sigmoid(x,v = 5)
plot(x,y,type="l",main="Other sigmoid functions")
lines(x,y2,col=2)
lines(x,y3,col=3)