Learn R Programming

mlmts (version 1.1.2)

dis_gcc: Constructs a pairwise distance matrix based on the generalized cross-correlation

Description

dis_gcc returns a pairwise distance matrix based on the generalized cross-correlation measure introduced by alonso2019clustering;textualmlmts.

Usage

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

Value

If features = FALSE (default), returns a distance matrix based on the distance \(d_{GCC}\). 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_{GCC}\).

Arguments

X

A list of MTS (numerical matrices).

lag_max

The maximum lag considered to compute the generalized cross-correlation.

features

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

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_{GCC}(\boldsymbol X_T, \boldsymbol Y_T)=\Bigg[\sum_{j_1,j_2=1, j_1 \ne j_2}^{d} \bigg(\widehat{GCC}(\boldsymbol X_{T,j_1}, \boldsymbol X_{T,j_2} )-\widehat{GCC}(\boldsymbol Y_{T,j_1},\boldsymbol Y_{T,j_2})\bigg)^2\Bigg]^{1/2},$$ where \(\boldsymbol X_{T,j}\) and \(\boldsymbol Y_{T,j}\) are the \(j\)th dimensions (univariate time series) of \(\boldsymbol X_T\) and \(\boldsymbol Y_T\), respectively, and \(\widehat{GCC}(\cdot, \cdot)\) is the estimated genelarized cross-correlation measure between univariate series proposed by alonso2019clustering;textualmlmts.

References

alonso2019clusteringmlmts

Examples

Run this code
toy_dataset <- AtrialFibrillation$data[1 : 10] # Selecting the first 10 MTS from the
# dataset AtrialFibrillation
distance_matrix <- dis_gcc(toy_dataset) # Computing the pairwise
# distance matrix based on the distance dis_cor
feature_dataset <- dis_gcc(toy_dataset, features = TRUE) # Computing
# the corresponding dataset of features

Run the code above in your browser using DataLab