fexpit: Helper function: expanded expit

View source: R/utils.R

fexpitR Documentation

Helper function: expanded expit

Description

Helper function: expanded expit

Usage

fexpit(x, sqz = 0.000001)

Arguments

x

a vector of values between -Inf and +Inf

sqz

the amount by which we 'squoze', default is .000001

Value

   a vector of values between 0 and 1 inclusive

Examples


x <- rnorm(n = 1000)
summary(x)

sqz <- 1 / (10**6)
p <- fexpit(x, sqz = sqz)
summary(p)

all((abs(x - flogit(p)) / x) < sqz)
all(abs(x - flogit(fexpit(x))) < sqz)


biobenkj/compartmap documentation built on April 5, 2025, 9:17 a.m.