logit: logistic transformation

View source: R/transformations.R

logitR Documentation

logistic transformation

Description

Maps numbers from [0,1] to [-∞,+∞] and back.

Usage

logit(x, ...)

## Default S3 method:
logit(x, inverse = FALSE, ...)

## S3 method for class 'density'
logit(x, inverse = TRUE, ...)

Arguments

x

a vector of real numbers (strictly positive if inverse=FALSE) or an object of class density.

...

optional arguments to the log function.

inverse

logical. If inverse=FALSE, returns \ln\!≤ft[\frac{x}{1-x}\right]; otherwise returns \frac{\exp[x]}{\exp[x]+1}.

Value

a vector with the same length of x

Examples

data(catchments,package='geostats')
lp <- logit(catchments$vegetation/100,inverse=FALSE)
ld <- density(lp)
d <- logit(ld,inverse=TRUE)
plot(d)

geostats documentation built on Jan. 7, 2023, 5:32 p.m.

Related to logit in geostats...