Metrics#
This module contains multiple functional distances and norms.
Lp Spaces#
The following classes compute the norms and metrics used in Lp spaces. One
first has to create an instance for the class, specifying the desired value
for p
, and use this instance to evaluate the norm or distance over
functional data objects.
|
Norm of all the observations in a FDataGrid object. |
|
Lp distance for functional data objects. |
As the \(L_1\), \(L_2\) and \(L_{\infty}\) norms are very common
in FDA, instances for these have been created, called respectively
l1_norm
, l2_norm
and linf_norm
. The same is true for metrics,
having l1_distance
, l2_distance
and linf_distance
already
created.
The following functions are wrappers for convenience, in case that one
only wants to evaluate the norm/metric for a value of p
. These functions
cannot be used in objects or methods that require a norm or metric, as the
value of p
must be explicitly passed in each call.
|
Calculate the norm of all the observations in a FDataGrid object. |
|
Lp distance for FDataGrid objects. |
Angular distance#
The angular distance (using the normalized “angle” between functions given by the inner product) is also available, and useful in some contexts.
Calculate the angular distance between two objects. |
Elastic distances#
The following functions implements multiple distances used in the elastic analysis and registration of functional data.
Compute the Fisher-Rao distance between two functional objects. |
|
Compute the Fisher-Rao amplitude distance between two functional objects. |
|
Compute the Fisher-Rao phase distance between two functional objects. |
Mahalanobis distance#
The following class implements a functional version of the Mahalanobis distance:
Functional Mahalanobis distance. |
Metric induced by a norm#
If a norm has been defined, it is possible to construct a metric between two elements simply subtracting one from the other and computing the norm of the result. Such a metric is called the metric induced by the norm, and the \(Lp\) distance is an example of these. The following class can be used to construct a metric from a norm in this way:
Metric induced by a norm. |
Pairwise metric#
Some tasks require the computation of all possible distances between pairs of objets. The following class can compute that efficiently:
Pairwise metric function. |
Transformation metric#
Some metrics, such as those based in derivatives, can be expressed as a transformation followed by another metric:
Compute a distance after transforming the data. |