From thomas@biostat.washington.edu  Fri Mar 17 23:38:48 2000
From: thomas@biostat.washington.edu (Thomas Lumley)
Date: Fri, 17 Mar 2000 15:38:48 -0800 (PST)
Subject: [Rd] d-p-q-r-tests: why is plnorm(exp(Inf)) equal pnorm(Inf)?
In-Reply-To: <38d2b9ec.thoffman.zappa@zappa.sax.de>
Message-ID: <Pine.GSO.4.21.0003171536410.29432-100000@mail.biostat.washington.edu>

On Sat, 18 Mar 2000, Thomas Hoffmann wrote:

> I stumbled across a result of d-p-q-r-tests:
> 
> d-p-q-r-tests expects pnorm(Inf) and pnorm(-Inf)  to give the same results as  plnorm(exp(Inf)) 
> and plnorm(exp(-Inf)), respectively.
> 
> Does this mean that all expressions result in NaN (which I expect for
> the 3rd and 4th expression only) or does it mean that R can prevent
> the exp(Inf) to be evaluated before being parsed in the context of
> plnorm?

No, it means that exp(Inf) and exp(-Inf) are evaluated correctly (Inf and
0 respectively) and the lognormal cdf is then evaluated as 1 and 0
respectively. 

If the result were NaN then equality would not hold. Nothing is equal to
NaN, not even itself.



	-thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] d-p-q-r-tests: why is plnorm(exp(Inf)) equal pnorm(Inf)?
Thomas Lumley