[R] infinity in integrate function in R

Jim Lindsey james.lindsey at luc.ac.be
Wed Nov 8 09:48:23 CET 2000


> 
> The integrate function in R is not taking Inf (infinity). How do you use
> infinity in R. I was doing: integrate(dnorm, Inf, 1.96) and I was getting
> Error: NA/NaN/Inf in foreign function call (arg 2). Obviously this should
> be equal to pnorm(1.96)= 0.9750021. How do you get around the infinity
> problem in R?

The int function in my rmutil library at
www.luc.ac.be/~jlindsey/rcode.html
will handle infinite integration limits. Jim

> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help 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-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list