dis_swmd {mlmts}R Documentation

Constructs a pairwise distance matrix based on VPCA and SWMD

Description

dis_swmd returns a pairwise distance matrix based on variable-based principal component analysis (VPCA) and a spatial weighted matrix distance (SWMD) (He and Tan 2018).

Usage

dis_swmd(X, var_rate = 0.9, features = FALSE)

Arguments

X

A list of MTS (numerical matrices).

var_rate

Rate of retained variability concerning the dimensionality-reduced MTS samples (default is 0.90).

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_{SWMD}(\boldsymbol X_T, \boldsymbol Y_T)=\Big[\big(vec (\boldsymbol Z^{\boldsymbol X_T})-vec(\boldsymbol Z^{\boldsymbol Y_T})\big)\boldsymbol S\big(vec(\boldsymbol Z^{\boldsymbol X_T})-vec(\boldsymbol Z^{\boldsymbol Y_T})\big)^\top\Big]^{1/2},

where \boldsymbol Z^{\boldsymbol X_T} and \boldsymbol Z^{\boldsymbol Y_T} are the dimensionality- reduced MTS samples associated with \boldsymbol X_T and \boldsymbol Y_T, respectively, the operator vec(\cdot) creates a vector by concatenating the columns of the matrix received as input and \boldsymbol S is a matrix integrating the spatial dimensionality difference between the corresponding elements.

Value

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

Author(s)

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

References

He H, Tan Y (2018). “Unsupervised classification of multivariate time series using VPCA and fuzzy clustering with spatial weighted matrix distance.” IEEE transactions on cybernetics, 50(3), 1096–1105.

See Also

vpca_clustering

Examples

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

[Package mlmts version 1.1.1 Index]