R/logit.R

Defines functions inv.logit logit

Documented in inv.logit logit

logit <- function(x, min=0, max=1)
  {
    p <- (x-min)/(max-min)
    log(p/(1-p))
  }

inv.logit <- function(x, min=0, max=1)
  {
    p <- exp(x)/(1+exp(x))
    p <- ifelse( is.na(p) & !is.na(x), 1, p ) # fix problems with +Inf
    p * (max-min) + min
  }
                 

Try the hSDM package in your browser

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

hSDM documentation built on Sept. 8, 2023, 6:08 p.m.