Math.funData: Mathematical operations for functional data objects

Description Usage Arguments Value See Also Examples

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

1
2
3
4
5
6
7
8
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 Oct. 17, 2021, 5:06 p.m.