Learn R Programming

mlmts (version 1.1.2)

dis_eros: Constructs a pairwise distance matrix based on the Eros distance measure

Description

dis_eros returns a pairwise distance matrix based on the Eros distance proposed by yang2004pca;textualmlmts.

Usage

dis_eros(X, method = "mean", normalization = FALSE, cor = TRUE)

Value

The computed pairwise distance matrix.

Arguments

X

A list of MTS (numerical matrices).

method

The aggregated function to compute the weights.

normalization

Logical indicating whether the raw eigenvalues or the normalized eigenvalues should be used to compute the weights. Default is FALSE, i.e., the raw eigenvalues are used.

cor

Logical indicating whether the Singular Value Decomposition is applied over the covariance matrix or over the correlation matrix. Default is TRUE, i.e., the correlation matrix is employed to avoid issues of scale.

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_{Eros}(\boldsymbol X_T, \boldsymbol Y_T)=\sqrt{2-2Eros(\boldsymbol X_T, \boldsymbol Y_T)}\), where $$Eros(\boldsymbol X_T, \boldsymbol Y_T)=\sum_{i=1}^{d}w_i|<\boldsymbol x_i,\boldsymbol y_i>|= \sum_{i=1}^{d}w_i|\cos \theta_i|,$$ where \(\{\boldsymbol x_1, \ldots, \boldsymbol x_d\}\), \(\{\boldsymbol y_1, \ldots, \boldsymbol y_d\}\) are sets of eigenvectors concerning the covariance or correlation matrix of series \(\boldsymbol X_T\) and \(\boldsymbol Y_T\), respectively, \(<\boldsymbol x_i,\boldsymbol y_i>\) is the inner product of \(\boldsymbol x_i\) and \(\boldsymbol y_i\), \(\boldsymbol w=(w_1, \ldots, w_d)\) is a vector of weights which is based on the eigenvalues of the MTS dataset with \(\sum_{i=1}^{d}w_i=1\) and \(\theta_i\) is the angle between \(\boldsymbol x_i\) and \(\boldsymbol y_i\).

References

yang2004pcamlmts

Examples

Run this code
toy_dataset <- BasicMotions$data[1 : 10] # Selecting the first 10 MTS from the
# dataset BasicMotions
distance_matrix <- dis_eros(toy_dataset) # Computing the pairwise
# distance matrix based on the distance dis_eros
distance_matrix <- dis_eros(toy_dataset, method = 'max', normalization = TRUE)
# Considering the function max as aggregation function and the normalized
# eigenvalues for the computation of the weights

Run the code above in your browser using DataLab