trapeze: Trapeze integration from a vector of function values...

Description Usage Arguments Value Examples

View source: R/trapeze.R

Description

Trapeze integration from a vector of function values evaluated at quadrature points

Usage

1
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

1
2
x = seq(-4,2,length=100) ; fx = dnorm(x) ; res = trapeze(x,fx)
cbind(true=pnorm(x),trapeze=res)

cubicBsplines documentation built on July 13, 2021, 5:08 p.m.