Learn R Programming

mlmts (version 1.1.2)

dis_modwt: 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 d2012wavelets;textualmlmts.

Usage

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

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}\).

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.

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_{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.

References

d2012waveletsmlmts

See Also

modwt

Examples

Run this code
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

Run the code above in your browser using DataLab