dis_2dsvd: Constructs a pairwise distance matrix based on...

View source: R/dis_2dsvd.R

dis_2dsvdR Documentation

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 \insertCiteweng2008classification;textualmlmts.

Usage

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

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.

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 bth 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.

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

Author(s)

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

References

\insertRef

weng2008classificationmlmts

Examples

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

mlmts documentation built on Sept. 11, 2024, 6:41 p.m.

Related to dis_2dsvd in mlmts...