dis_cor {mlmts}R Documentation

Constructs a pairwise distance matrix based on auto and cross-correlations

Description

dis_cor returns a pairwise distance matrix based on a generalization of the dissimilarity introduced by D'Urso and Maharaj (2009).

Usage

dis_cor(X, lag_max = 1, features = FALSE)

Arguments

X

A list of MTS (numerical matrices).

lag_max

The maximum lag considered to compute the auto and cross-correlations.

features

Logical. If features = FALSE (default), a distance matrix is returned. Otherwise, the function returns a dataset of feature vectors.

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_{COR}(\boldsymbol X_T, \boldsymbol Y_T)=\Big|||\widehat{\boldsymbol \theta}^{\boldsymbol X_T}_{AC}- \widehat{\boldsymbol \theta}^{\boldsymbol Y_T}_{AC}||^2+||\widehat{\boldsymbol \theta}^{\boldsymbol X_T}_{CC}- \widehat{\boldsymbol \theta}^{\boldsymbol Y_T}_{CC}||^2\Big|^{1/2},

where \widehat{\boldsymbol \theta}^{\boldsymbol X_T}_{AC} and \widehat{\boldsymbol \theta}^{\boldsymbol Y_T}_{AC} are vectors containing the estimated autocorrelations within \boldsymbol X_T and \boldsymbol Y_T, respectively, and \widehat{\boldsymbol \theta}^{\boldsymbol X_T}_{CC} and \widehat{\boldsymbol \theta}^{\boldsymbol Y_T}_{CC} are vectors containing the estimated cross-correlations within \boldsymbol X_T and \boldsymbol Y_T, respectively.

Value

If features = FALSE (default), returns a distance matrix based on the distance d_{COR}. Otherwise, the function returns a dataset of feature vectors, i.e., each row in the dataset contains the features employed to compute the distance d_{COR}.

Author(s)

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

References

D'Urso P, Maharaj EA (2009). “Autocorrelation-based fuzzy clustering of time series.” Fuzzy Sets and Systems, 160(24), 3565–3589.

Examples

toy_dataset <- AtrialFibrillation$data[1 : 10] # Selecting the first 10 MTS from the
# dataset AtrialFibrillation
distance_matrix <- dis_cor(toy_dataset) # Computing the pairwise
# distance matrix based on the distance dis_cor
distance_matrix <- dis_cor(toy_dataset, lag_max = 5) # Considering
# auto and cross-correlations up to lag 5 in the computation of the distance
feature_dataset <- dis_cor(toy_dataset, features = TRUE) # Computing
# the corresponding dataset of features

[Package mlmts version 1.1.1 Index]