Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

GLIntegrate

Gauss-Legendre Quadrature


Description

Gauss-Legendre quadrature over a finite interval.

Usage

GLIntegrate(f, lower, upper, order = 500, ...)

Arguments

f

an R function taking a numeric first argument and returning a numeric vector of the same length. Returning a non-finite element will generate an error.

lower

finite lower limit of integration.

upper

finite upper limit of integration.

order

order of Gauss-Legendre quadrature.

...

additional arguments to be passed to f. Remember to use argument names not matching those of GLIntegrate!

Details

In case order = 100, 500, 1000 saved abscissas and weights are used. Otherwise the corresponding abscissas and weights are computed using the algorithm given in Section 4.5 of Press et al. (1992).

Value

Estimate of the integral.

Author(s)

References

W.H. Press, S.A. Teukolsky, W.T. Vetterling, B.P. Flannery (1992) Numerical Recipies in C. The Art of Scientific Computing. Second Edition. Cambridge University Press.

See Also

Examples

integrate(dnorm, -1.96, 1.96)
GLIntegrate(dnorm, -1.96, 1.96)

distrEx

Extensions of Package 'distr'

v2.8.0
LGPL-3
Authors
Matthias Kohl [cre, cph], Peter Ruckdeschel [aut, cph]
Initial release
2019-03-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.