logit: Compute an extended logit transformation of a real vector

View source: R/numericFunctions.R

logitR Documentation

Compute an extended logit transformation of a real vector

Description

Compute an extended logit transformation of a real vector

Usage

logit(x, repl.inf = FALSE, bound = 1e+12)

Arguments

x

A real-valued vector with elements in [0,1].

repl.inf

(Logical) Replace -Inf and Inf values with finite approximations (Default: FALSE).

bound

Absolute value of the finite approximation to -Inf and Inf (Default: 1e-12).

Details

In contrast to the conventional logit function which has support on (0,1), this version has support on [0,1], where /codelogit(0) = ⁠-Inf⁠ and /codelogit(1) = ⁠Inf⁠. For sloppy computational convenience when, for example, averaging logits, the infinte values can be replaced with finite approximations.

Value

A numeric vector containing logit(x). See Details.

Author(s)

Steve Gutreuter

See Also

logit from the boot package for a conventional C++ alternative.


sgutreuter/SGmisc documentation built on Aug. 25, 2024, 7:21 p.m.