R/new_functions.R

Defines functions invlogit2 invlogit logit erf

# NOTE:
# Rather than specifying these functions only in the environment of Deriv,
# they are specified globally here. That way Deriv sees them, but they can also
# be seen by RTMB, and also when computing various statistics of the return fit

erf <- function(x) 2 * pnorm(sqrt(2)*x) - 1

logit <- function(x) log(x/(1-x))

invlogit <- function(x) 1/(1+exp(-x))

invlogit2 <- function(x,a,b) 1/(1+exp(-a*(x-b)))

Try the ctsmTMB package in your browser

Any scripts or data that you put into this service are public.

ctsmTMB documentation built on April 12, 2025, 1:45 a.m.