SimpsonInt {NPHazardRate}R Documentation

Simpson numerical integration

Description

Implements Simpson's extended numerical integration rule

Usage

SimpsonInt(xin, h)

Arguments

xin

A vector of data points

h

grid length

Details

The extended numerical integration rule is given by

\int_0^{x_{2n}} f(x)\,dx = \frac{h}{3}(f(x_0) + 4\{f(x_1) + \dots f(x_{2n-1}) \} +2 \{f(x_2) + f(x_4) + \dots f(x_{2n-2})\} + f(x_{2n})) -R_n

Value

returns the approximate integral value

References

Weisstein, Eric W. "Simpson's Rule." From MathWorld–A Wolfram Web Resource


[Package NPHazardRate version 0.1 Index]