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

maechler@stat.math.ethz.ch maechler@stat.math.ethz.ch
Thu Dec 26 11:39:02 2002


>>>>> "GB" == Göran Broström <gb@stat.umu.se>
>>>>>     on Thu, 26 Dec 2002 01:17:21 +0100 (CET) writes:

    GB> On 25 Dec 2002, Peter Dalgaard BSA wrote:
    >> 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)))

    GB> Or use 'plogis(x)', eventually with 'lower.tail = ...'
    GB> ...

yes, really!

inv.logit() should never have made its way into the boot
package at all I think.
I mean neither in tto the S-plus "library".  plogis() has bveen
part of S since ages AFAIK.


Martin Maechler <maechler@stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><