This function operates on a univariate functional dataset and transforms its observations unfolding their values and turning them into monotone functions.
unfold(fData)
the univariate functional dataset in form of fData
object.
The function returns an fData
object whose observations are
the unfolded version of the corresponding observations in the argument
fData
.
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.
Arribas-Gil, A. and Romo, J. (2012). Robust depth-based estimation in the time warping model, Biostatistics, 13 (3), 398--414.
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)