trapeze {cubicBsplines} | R Documentation |
Trapeze integration from a vector of function values evaluated at quadrature points
Description
Trapeze integration from a vector of function values evaluated at quadrature points
Usage
trapeze(x, fx)
Arguments
x |
grid of values for the quadrature (vector). |
fx |
values of the function on the grid (vector). |
Value
vector with a numerical approximation of \int_{min(x)}^{max(x)} f(t) dt
on the grid using the trapeze method.
Examples
x = seq(-4,2,length=100) ; fx = dnorm(x) ; res = trapeze(x,fx)
cbind(true=pnorm(x),trapeze=res)
[Package cubicBsplines version 1.0.0 Index]