Learn R Programming

mlmts (version 1.1.2)

dis_pca: Constructs a pairwise distance matrix based on Principal Component Analysis (PCA)

Description

dis_eros returns a pairwise distance matrix based on the PCA similarity factor proposed by singhal2005clustering;textualmlmts.

Usage

dis_pca(X, retained_components = 3)

Value

The computed pairwise distance matrix.

Arguments

X

A list of MTS (numerical matrices).

retained_components

Number of retained principal components.

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_{PCA}(\boldsymbol X_{T}, \boldsymbol Y_{T})=1-S_{PCA} (\boldsymbol X_{T}, \boldsymbol Y_{T})\), with $$S_{PCA}(\boldsymbol X_{T}, \boldsymbol Y_{T})=\frac{\sum_{i=1}^{k}\sum_{j=1}^{k} (\lambda^i_{\boldsymbol X_T} \lambda^j_{\boldsymbol Y_T})\cos^2 \theta_{ij}}{\sum_{i=1}^{k} \lambda^i_{\boldsymbol X_T} \lambda^i_{\boldsymbol Y_T}},$$ where \(\theta_{ij}\) is the angle between the \(i\)th eigenvector of \(\boldsymbol X_{T}\) and the \(j\)th eigenvector of series \(\boldsymbol Y_{T}\), respectively, and \(\lambda^i_{\boldsymbol Y_T}\) and \(\lambda^i_{\boldsymbol Y_T}\) are the \(i\)th eigenvalues of \(\boldsymbol X_{T}\) and the \(j\)th eigenvalues of series \(\boldsymbol Y_{T}\) respectively.

References

singhal2005clusteringmlmts

Examples

Run this code
toy_dataset <- BasicMotions$data[1 : 10] # Selecting the first 10 MTS from the
# dataset BasicMotions
distance_matrix <- dis_pca(toy_dataset) # Computing the pairwise
# distance matrix based on the distance dis_pca

Run the code above in your browser using DataLab