unfold: Unfolding a univariate functional dataset

Description Usage Arguments Details Value References See Also Examples

View source: R/fData.R

Description

This function operates on a univariate functional dataset and transforms its observations unfolding their values and turning them into monotone functions.

Usage

1

Arguments

fData

the univariate functional dataset in form of fData object.

Details

Each function of the fData object is transformed into a non-monotone function into a monotone function by “unfolding” it at any of its maxima. For more details about the definition of the transform, see the reference.

Value

The function returns an fData object whose observations are the unfolded version of the corresponding observations in the argument fData.

References

Arribas-Gil, A. and Romo, J. (2012). Robust depth-based estimation in the time warping model, Biostatistics, 13 (3), 398–414.

See Also

fData, warp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
P = 1e3

time_grid = seq( 0, 1, length.out = P )

D = matrix( c( sin( 2 * pi * time_grid ),
               cos( 2 * pi * time_grid ),
               sin( 10 * pi * time_grid ) * time_grid + 2 ),
            ncol = P, nrow = 3, byrow = TRUE )

# Functional dataset
fD = fData( time_grid, D )

# Unfolded version
fD_unfold = unfold( fD )

dev.new()
oldpar <- par(mfrow = c(1, 1))
par(mfrow = c(1, 2))

plot(fD, main = 'Original data')
plot(fD_unfold, main = 'Unfolded data')

par(oldpar)

roahd documentation built on Nov. 4, 2021, 1:07 a.m.