[R] R numerical integration

casperyc casperyc at hotmail.co.uk
Fri Mar 23 21:27:57 CET 2012


Hi all,

Is there any other packages to do numerical integration other than the
default 'integrate'?

Basically, I am integrating:

integrate(function(x) dnorm(x,mu,sigma)/(1+exp(-x)),-Inf,Inf)$value

The integration is ok provided sigma is >0.

However, when mu=-1.645074 and sigma=17535.26

It stopped working. On the other hand, Maple gives me a value of
0.5005299403.

It is an important line of the coding that I am doing and I am looking for
some package that is able to do numerical integration efficiently (fast and
accurate to a tol=1e-4). I have tried 'cubature', which does not give me
anything even after 10 minutes.

Thanks.

casper



-----
###################################################
PhD candidate in Statistics
School of Mathematics, Statistics and Actuarial Science, University of Kent
###################################################

--
View this message in context: http://r.789695.n4.nabble.com/R-numerical-integration-tp4500095p4500095.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list