gaussint: Gaussian integration method driver

Description Usage Arguments Details Value See Also Examples

View source: R/gaussint.R

Description

Use the Gaussian method to evaluate integrals

Usage

1
2
3
4
5
6
7
gaussint(f, x, w)

gauss.legendre(f, m = 5)

gauss.laguerre(f, m = 5)

gauss.hermite(f, m = 5)

Arguments

f

function to integrate

x

list of evaluation points

w

list of weights

m

number of evaluation points

Details

The gaussint function uses the Gaussian integration to evaluate an integral. The function itself is a driver and expects the integration points and associated weights as options.

Value

the value of the integral

See Also

Other integration: adaptint(), giniquintile(), mcint(), midpt(), revolution-solid, romberg(), simp38(), simp(), trap()

Examples

1
2
3
4
w = c(1, 1)
x = c(-1 / sqrt(3), 1 / sqrt(3))
f <- function(x) { x^3 + x + 1 }
gaussint(f, x, w)

cmna documentation built on July 14, 2021, 5:11 p.m.