integrate.mstR: Numerical integration by linear interpolation (for mstR...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This command computes the integral of function f(x) by providing values of x and f(x), similarly to the integrate.xy function of the R package sfsmisc.

Usage

1
2

Arguments

x

numeric: a vector of x values for numerical integration.

y

numeric: a vector of numerical values corresponding to f(x) values.

Details

This function was written to compute "cheap" numerical integration by providing sequences of x values and corresponding computed values f(x). It works similarly as the integrate.xy function when use.spline=FALSE is required. It was developed internally to eventually remove dependency of mstR package to package sfsmisc.

Value

The approximated integral.

Author(s)

David Magis
Department of Psychology, University of Liege, Belgium
david.magis@uliege.be

References

Maechler, M. et al. (2012). sfsmisc: Utilities from Seminar fuer Statistik ETH Zurich. R package version 1.0-23. http://CRAN.R-project.org/package=sfsmisc

See Also

The integrate.xy function in package sfsmisc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  x <- seq(from = -4, to = 4, length = 33)
 y <- exp(x)
 integrate.mstR(x, y) # 54.86381

## Not run: 

 # Comparison with integrate.xy
 require(sfsmisc)
 integrate.xy(x, y, use.spline = FALSE) # 54.86381
 integrate.xy(x, y) # 54.58058
 
## End(Not run)

mstR documentation built on May 2, 2019, 8:28 a.m.

Related to integrate.mstR in mstR...