Learn R Programming

fda.usc (version 1.2.3)

int.simpson: Simpson integration

Description

Computes the integral of fdataobj$data with respect to fdataobj$argvals using simpson or trapezoid rule integration.

Usage

int.simpson(fdataobj,equi=TRUE,method="TRAPZ")

Arguments

fdataobj
fdata objtect.
equi
=TRUE, the observed points on each curve are equally spaced (by default).
method
Method for numerical integration, see details.

Details

If method="CSR", composite Simpson's rule integration is used. If method="ESR", extended Simpson's rule integration is used. If method="TRAPZ", Trapezoid rule integration is used.

See Also

See also integrate.

Examples

Run this code
x<-seq(0,2*pi,length=1001)
fx<-fdata(sin(x)/sqrt(pi),x)
fx0<-fdata(rep(0,length(x)),x)
int.simpson(fx0$data,fx$data)
int.simpson(fx)

Run the code above in your browser using DataLab