dis_eros {mlmts} | R Documentation |
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 Yang and Shahabi (2004).
Usage
dis_eros(X, method = "mean", normalization = FALSE, cor = TRUE)
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
|
cor |
Logical indicating whether the Singular Value Decomposition is
applied over the covariance matrix or over the correlation matrix. Default
is |
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
.
Value
The computed pairwise distance matrix.
Author(s)
Ángel López-Oriona, José A. Vilar
References
Yang K, Shahabi C (2004). “A PCA-based similarity measure for multivariate time series.” In Proceedings of the 2nd ACM international workshop on Multimedia databases, 65–74.
Examples
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