Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

integrate

Integrate functional data


Description

Integrate all observations of a funData, irregFunData or multiFunData object over their domain.

Usage

integrate(object, ...)

Arguments

object

An object of class funData, irregFunData or multiFunData.

...

Further parameters (see Details).

Details

Further parameters passed to this function may include:

  • method: Character string. The integration rule to be used, passed to the internal function .intWeights. Defaults to "trapezoidal" (alternative: "midpoint").

  • fullDom: Logical. If object is of class irregFunData, setting fullDom = TRUE extrapolates all functions linearly to the full domain before calculating the integrals. Defaults to FALSE. For details on the extrapolation, see extrapolateIrreg.

Value

A vector of numerics, containing the integral values for each observation.

Warning

The function is currently implemented only for functional data with up to three-dimensional domains. In the default case, this function calls integrate.

See Also

Examples

# Univariate
object <- funData(argvals = 1:5, X = rbind(1:5, 6:10))
integrate(object)

# Univariate (irregular)
irregObject <-irregFunData(argvals = list(1:5, 2:4), X = list(2:6, 3:5))
integrate(irregObject) # fullDom = FALSE
integrate(irregObject, fullDom = TRUE)

# Multivariate
multiObject <- multiFunData(object, funData(argvals = 1:3, X = rbind(3:5, 6:8)))
integrate(multiObject)

funData

An S4 Class for Functional Data

v1.3-5
GPL-2
Authors
Clara Happ-Kurz [aut, cre]
Initial release
2020-04-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.