simpson: Computing integration numerically through the Simpson's...

Description Usage Arguments Author(s) References Examples

Description

Computes the integration for a real-valued function.

Usage

1
simpson(fun, lb, ub, N = 100)

Arguments

fun

Integrand expression

lb

Lower bound of integration.

ub

Upper bound of integration.

N

An even integer value indicating the number of subdivisions for applying Simpson's integration method.

Author(s)

Mahdi Teimouri

References

E. Suli and D. Mayers 2003. An Introduction to Numerical Analysis, Cambridge University Press.

Examples

1
2
3
4
5
6
7
    fun <- function(x) 1/sqrt( 2*pi*sigma^2 )*exp( -.5*(x-mu)^2/sigma^2 )
    mu <- 0
 sigma <- 1
    lb <- 0
    ub <- Inf
     N <- 100
simpson(fun = fun, lb = lb, ub = ub, N = N)

bccp documentation built on May 18, 2021, 9:07 a.m.

Related to simpson in bccp...