3

I have been learning about QUADPACK and I used scipy.integrate.quad to calculate an integral from 0 to infinite. It gave a very good result, but now I want to know which integration method (QAGI, QAWF,etc.) the software has applied. Is there any way for printing the technique? Does the software apply some decision tree? Thanks in advance for your time. Regards.

davidsaezsan
  • 133
  • 4
  • 1
    I don't see a reason to put this on hold, this is a very precise question if you use scipy.integrate.quad. – Josef Jan 18 '14 at 21:34

1 Answers1

4

As scipy is open source, you can actually read the code for integrate.quad, which says:

For finite integration limits, the integration is performed using a Clenshaw-Curtis method which uses Chebyshev moments. ... If one of the integration limits is infinite, then a Fourier integral is computed (assuming w neq 0).

The call in _quad for an infinite bound is to _quadpack._qagie.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • to find some information without looking at the source itself. "Run scipy.integrate.quad_explain() for more information on the more esoteric inputs and outputs." – Josef Jan 18 '14 at 21:36
  • Actually the one you quoted appears under the "Weighting the integrand" section. If no weight is specified, adaptive 21-point Gauss–Kronrod quadrature is used. Infinite intervals are handled via mapping to finite interval. See also QUADPACK's documentation for QAGI. – syockit Aug 28 '20 at 09:21