Learn R Programming

mlmts (version 1.1.2)

dis_2dsvd: Constructs a pairwise distance matrix based on two-dimensional singular value decomposition (2dSVD)

Description

dis_2dsvd returns a pairwise distance matrix based on the 2dSVD distance measure proposed by weng2008classification;textualmlmts.

Usage

dis_2dsvd(X, var_u = 0.9, var_v = 0.9, features = FALSE)

Value

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

Arguments

X

A list of MTS (numerical matrices).

var_u

Rate of retained variability concerning the row-row covariance matrix.

var_v

Rate of retained variability concerning the column-column covariance matrix.

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_{2dSVD}(\boldsymbol X_T, \boldsymbol Y_T)=\sum_{b=1}^s||{\boldsymbol M}^{\boldsymbol X_T}_{\bullet, b}- {\boldsymbol M}^{\boldsymbol Y_T}_{\bullet, b}||,$$ where \({\boldsymbol M}^{\boldsymbol X_T}_{\bullet, b}\) and \({\boldsymbol M}^{\boldsymbol Y_T}_{\bullet, b}\) are the \(b\)th columns of matrices \({\boldsymbol M}^{\boldsymbol X_T}\) and \({\boldsymbol M}^{\boldsymbol Y_T}\), which are obtained by decomposing the time series \(\boldsymbol X_T\) and \(\boldsymbol Y_T\), respectively, by means of the 2dSVD procedure (average row-row and column-column covariance matrices are taken into account), and \(s\) is the number of first retained eigenvectors concerning the average column-column covariance matrices.

References

weng2008classificationmlmts

Examples

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

Run the code above in your browser using DataLab