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