Math.funData: Mathematical operations for functional data objects

Math.funDataR Documentation

Mathematical operations for functional data objects

Description

These functions allow to apply mathematical operations (such as exp(), log(), sin(), cos() or abs() to functional data objects based on Math. The operations are made pointwise for each observation.

Usage

## S4 method for signature 'funData'
Math(x)

## S4 method for signature 'multiFunData'
Math(x)

## S4 method for signature 'irregFunData'
Math(x)

Arguments

x

An object of class funData, irregFunData or multiFunData.

Value

An object of the same functional data class as x.

See Also

funData, irregFunData, multiFunData, Math

Examples

oldpar <- par(no.readonly = TRUE)
par(mfrow = c(1,2))

# simulate a funData object on 0..1 with 10 observations
argvals <- seq(0, 1, 0.01)
f <- simFunData(argvals = argvals, N = 10, 
                M = 5, eFunType = "Fourier", eValType = "linear")$simData

### FunData
plot(f, main = "Original data")
plot(abs(f), main = "Absolute values")

### Irregular
# create an irrgFunData object by sparsifying f
i <- as.irregFunData(sparsify(f, minObs = 5, maxObs = 10))

plot(i, main = "Sparse data")
plot(cumsum(i), main = "'cumsum' of sparse data")

### Multivariate
m <- multiFunData(f, -1*f)
plot(m, main = "Multivariate Data")
plot(exp(m), main = "Exponential")

par(oldpar)

funData documentation built on May 29, 2024, 6:08 a.m.