sorry the integration was from -Inf to 1.96 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? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 7 Nov 2000 eloi_kpamegan at hgsi.com wrote:> 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 integrate function doesn't know how to integrate over infinite regions. This is a different (and more difficult) problem than integrating over finite regions. -thomas Thomas Lumley Assistant Professor, Biostatistics University of Washington, Seattle -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
From: eloi_kpamegan at hgsi.com
X-Mailer: Lotus Notes Release 5.0.2c February 2, 2000
Date: Tue, 7 Nov 2000 16:02:43 -0500
X-MIMETrack: Serialize by Router on Mozart/Hgsi(Release 5.0.5 |September 22,
2000) at 11/07/2000
04:02:39 PM
MIME-Version: 1.0
Content-type: text/plain; charset=us-ascii
Sender: owner-r-help at stat.math.ethz.ch
Precedence: bulk
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?
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Transform to a finite interval and multiply your integrand by the
Jacobian of the transform.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> > 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._