View source: R/dis_mahalanobis.R
dis_mahalanobis | R Documentation |
dis_mahalanobis
returns a pairwise distance matrix based on the
Mahalanobis divergence introduced by \insertCitesinghal2005clustering;textualmlmts.
dis_mahalanobis(X)
X |
A list of MTS (numerical matrices). |
Given a collection of MTS, the function returns the pairwise distance matrix,
where the distance between two MTS \boldsymbol X_T
and \boldsymbol Y_T
is defined as
d_{MD}^*(\boldsymbol X_T, \boldsymbol Y_T)=\frac{1}{2}\Big(d_{MD}
(\boldsymbol X_T, \boldsymbol Y_T)+d_{MD}(\boldsymbol Y_T, \boldsymbol X_T)\Big),
with
d_{MD}(\boldsymbol X_T, \boldsymbol Y_T)=\sqrt{(\overline{\boldsymbol X}_T
-\overline{\boldsymbol Y}_T)\boldsymbol \Sigma_{\boldsymbol X_T}^{*-1}(\overline
{\boldsymbol X}_T-\overline{\boldsymbol Y}_T)^\top},
where \overline{\boldsymbol X}_T
and \overline{\boldsymbol Y}_T
are vectors containing the column-wise means concerning series
\boldsymbol X_T
and \boldsymbol Y_T
, respectively,
\boldsymbol \Sigma_{\boldsymbol X_T}
is the covariance matrix of \boldsymbol X_T
and
\boldsymbol \Sigma_{\boldsymbol X_T}^{*-1}
is the pseudo-inverse of \boldsymbol
\Sigma_{\boldsymbol X_T}
calculated using SVD.
In the computation of d_{MD}^*
, MTS \boldsymbol X_T
is assumed to be the reference series.
The computed pairwise distance matrix.
Ángel López-Oriona, José A. Vilar
singhal2005clusteringmlmts
dis_mahalanobis_dtw
toy_dataset <- AtrialFibrillation$data[1 : 10] # Selecting the first 10 MTS from the
# dataset AtrialFibrillation
distance_matrix <- dis_mahalanobis(toy_dataset) # Computing the pairwise
# distance matrix based on the distance dis_mahalanobis.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.