cmna (version 1.0.3)

gaussint: Gaussian integration method driver

Description

Use the Gaussian method to evaluate integrals

Usage

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

Value

the value of the integral

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.

See Also

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

Examples

Run this code
# NOT RUN {
w = c(1, 1)
x = c(-1 / sqrt(3), 1 / sqrt(3))
f <- function(x) { x^3 + x + 1 }
gaussint(f, x, w)

# }

Run the code above in your browser using DataLab