Re: [R] performance of adaptIntegrate vs. integrate

2011-11-11 Thread baptiste auguie
Dear Hans, [see inline below] On 11 November 2011 22:44, Hans W Borchers wrote: > baptiste auguie googlemail.com> writes: > >> >> Dear list, >> >> [cross-posting from Stack Overflow where this question has remained >> unanswered for two weeks] >> >> I'd like to perform a numerical integration i

Re: [R] performance of adaptIntegrate vs. integrate

2011-11-11 Thread baptiste auguie
Dear Ravi, Thank you for your answer. The integrand I proposed was a dummy example for demonstration purposes. I experienced a similar slowdown in a real problem, where knowing in advance the shape of the integrand would not be so easy. Your advice is sound; I would have to study the underlying

[R] performance of adaptIntegrate vs. integrate

2011-11-11 Thread Ravi Varadhan
The integrand is highly peaked. It is approximately an impulse function where much of the mass is concentrated at a very small interval. Plot the function and see for yourself. This is the likely cause of the problem. Other types of integrands where you could experience problems are: integran

Re: [R] performance of adaptIntegrate vs. integrate

2011-11-11 Thread Hans W Borchers
baptiste auguie googlemail.com> writes: > > Dear list, > > [cross-posting from Stack Overflow where this question has remained > unanswered for two weeks] > > I'd like to perform a numerical integration in one dimension, > > I = int_a^b f(x) dx > > where the integrand f: x in IR -> f(x) in I

[R] performance of adaptIntegrate vs. integrate

2011-11-10 Thread baptiste auguie
Dear list, [cross-posting from Stack Overflow where this question has remained unanswered for two weeks] I'd like to perform a numerical integration in one dimension, I = int_a^b f(x) dx where the integrand f: x in IR -> f(x) in IR^p is vector-valued. integrate() only allows scalar integrands,