sigmoid: Apply the Logistic or Logit functions

Description Usage Arguments Value Examples

Description

Applies the logistic function to a vector of continuous values, or if specified, applies the logit (log-odds) function to a vector of probabilities.

Usage

1
sigmoid(x, prob = F)

Arguments

x

Either a vector of unbounded continuous values, or if prob is TRUE, a vector of probabilities.

prob

Logical; if TRUE, assumes x is a vector of probabilities and applies the logit function.

Value

A transformed vector, either the result of the logistic function, or if prob is TRUE, the result of the logit function.

Examples

1
2
3
4
5
6
7
8
# Logistic function
sigmoid( 0 )
sigmoid( -1.098612 ); sigmoid( 1.098612 );
sigmoid( -Inf ); sigmoid( Inf )
# Logit function
sigmoid( 0, T )
sigmoid( .25, T ); sigmoid( .75, T )
sigmoid( 0, T ); sigmoid( 1, T )

rettopnivek/binclass documentation built on May 13, 2019, 4:46 p.m.