Re: [R] R numerical integration

2012-03-26 Thread Hans W Borchers
casperyc casperyc at hotmail.co.uk writes: I don't know what is wrong with your Maple calculations, but I think you should check them carefully, because: (1) As Petr explained, the value of the integral will be 0.5 (2) The approach of Peter still works and returns : 0.4999777 (3) And the same

Re: [R] R numerical integration

2012-03-25 Thread casperyc
The quadinf command in library pracma still fails when mu=-2.986731 with sigma=53415.18. While Maple gives me an estimate of 0.5001701024. Maple: (for those who are interested) myf:=(mu,sigma)-

Re: [R] R numerical integration

2012-03-24 Thread Hans W Borchers
casperyc casperyc at hotmail.co.uk writes: 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

Re: [R] R numerical integration

2012-03-24 Thread Hans W Borchers
Hans W Borchers hwborchers at googlemail.com writes: casperyc casperyc at hotmail.co.uk writes: Is there any other packages to do numerical integration other than the default 'integrate'? Basically, I am integrating: integrate(function(x)

Re: [R] R numerical integration

2012-03-24 Thread Petr Savicky
On Fri, Mar 23, 2012 at 01:27:57PM -0700, casperyc wrote: 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

Re: [R] R numerical integration

2012-03-24 Thread peter dalgaard
On Mar 24, 2012, at 09:46 , Petr Savicky wrote: Integrating with infinite limits is necessarily a heuristic. ...as is numerical integration in general. In the present case, the infinite limits are actually only half the problem. The integrate() function is usually quite good at dealing with

[R] R numerical integration

2012-03-23 Thread casperyc
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