dis_modwt {mlmts}R Documentation

Constructs a pairwise distance matrix based on the maximum overlap discrete wavelet transform

Description

dis_modwt returns a pairwise distance matrix based on the dissimilarity introduced by D'Urso and Maharaj (2012).

Usage

dis_modwt(X, wf = "d4", J = floor(log(nrow(X[[1]]))) - 1, features = FALSE)

Arguments

X

A list of MTS (numerical matrices).

wf

The wavelet filter (default is 'd4').

J

The maximum allowable number of scales.

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

where \widehat{\boldsymbol \theta}^{\boldsymbol X_T}_{WV} and \widehat{\boldsymbol \theta}^{\boldsymbol Y_T}_{WV} are vectors containing the estimated wavelet variances within \boldsymbol X_T and \boldsymbol Y_T, respectively, and \widehat{\boldsymbol \theta}^{\boldsymbol X_T}_{WC} and \widehat{\boldsymbol \theta}^{\boldsymbol Y_T}_{WC} are vectors containing the estimated wavelet correlations within \boldsymbol X_T and \boldsymbol Y_T, respectively.

Value

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

Author(s)

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

References

D'Urso P, Maharaj EA (2012). “Wavelets-based clustering of multivariate time series.” Fuzzy Sets and Systems, 193, 33–61.

See Also

modwt

Examples

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

[Package mlmts version 1.1.1 Index]