fdadist {fdacluster} | R Documentation |
Computes the distance matrix for functional data with amplitude and phase separation
Description
This function computes the matrix of pairwise distances between curves a functional data sample. This can be achieved with or without phase and amplitude separation, which can be done using a variety of warping classes.
Usage
fdadist(
x,
y = NULL,
warping_class = c("affine", "dilation", "none", "shift", "srsf"),
metric = c("l2", "pearson"),
cluster_on_phase = FALSE,
labels = NULL
)
Arguments
x |
A numeric vector of length |
y |
Either a numeric matrix of shape |
warping_class |
A string specifying the warping class Choices are
|
metric |
A string specifying the metric used to compare curves. Choices
are |
cluster_on_phase |
A boolean specifying whether clustering should be
based on phase variation or amplitude variation. Defaults to |
labels |
A character vector specifying curve labels. Defaults to |
Value
A stats::dist object storing the distance matrix between the input
curves using the metric specified through the argument metric
and the
warping class specified by the argument warping_class
.
Examples
idx <- c(1:5, 11:15, 21:25)
D <- fdadist(simulated30_sub$x[idx, ], simulated30_sub$y[idx, , ])