Learn R Programming

mlmts (version 1.1.2)

dis_mahalanobis: Constructs a pairwise distance matrix based on the Mahalanobis distance

Description

dis_mahalanobis returns a pairwise distance matrix based on the Mahalanobis divergence introduced by singhal2005clustering;textualmlmts.

Usage

dis_mahalanobis(X)

Value

The computed pairwise distance matrix.

Arguments

X

A list of MTS (numerical matrices).

Author

Ángel López-Oriona, José A. Vilar

Details

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.

References

singhal2005clusteringmlmts

See Also

dis_mahalanobis_dtw

Examples

Run this code
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.

Run the code above in your browser using DataLab