[Rd] inv.logit (package boot) (PR#2394)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
Wed Dec 25 18:10:03 2002


olefc@birc.dk writes:

> The problem is caused by exp(x) returning Inf when x is large.
> 
> One way of fixing the problem [there may be better ways] would be to include the
> line 
> 
> out[x > 709] <- 1
> 
> in inv.logit()

Yes, or replace the entire code with something like

  inv.logit2 <- function(x) ifelse(x > 0, 1 - 1/(1+exp(x)), 1/(1+exp(-x)))

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907