View source: R/integrate.catR.R
integrate.catR | R Documentation |
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
.
integrate.catR(x, y)
x |
numeric: a vector of x values for numerical integration. |
y |
numeric: a vector of numerical values corresponding to f(x) values. |
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 catR
package to package sfsmisc
.
The approximated integral.
David Magis
Department of Psychology, University of Liege, Belgium
david.magis@uliege.be
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
KL
and the integrate.xy
function in package sfsmisc
# Loading the 'tcals' parameters x <- seq(from = -4, to = 4, length = 33) y <- exp(x) integrate.catR(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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.