Learn R Programming

mlmts (version 1.1.2)

dis_lpp: Constructs a pairwise distance matrix based on locality preserving projections (LPP)

Description

dis_lpp returns a pairwise distance matrix based on the dissimilarity introduced by weng2008classificationlpp;textualmlmts.

Usage

dis_lpp(X, approach = 1, k = 2, t = 1, features = FALSE)

Value

If features = FALSE (default), returns a distance matrix based on the distance \(d_{QCD}\). Otherwise, the function returns a dataset of feature vectors, i.e., each row in the dataset contains the features resulting from applying Li's first (approach=1) or Li's second (approach=2).

Arguments

X

A list of MTS (numerical matrices).

approach

Parameter indicating whether the feature vector representing each MTS is constructed by means of Li's first (approach=1, default) or Li's second (approach=2) approach.

k

Number of neighbors determining the construction of the local structure matrix \(\boldsymbol S\).

t

Parameter determining the construction of the local structure matrix \(\boldsymbol S\) (denominator in the exponential transformation).

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_{LPP}(\boldsymbol X_T, \boldsymbol Y_T)= \big| \big| {\boldsymbol \varphi^{\boldsymbol X_T} \boldsymbol A_{LPP} - \boldsymbol \varphi^{\boldsymbol Y_T} \boldsymbol A_{LPP}} \big| \big|,$$ where \(\boldsymbol \varphi^{\boldsymbol X_T}\) and \(\boldsymbol \varphi^{\boldsymbol Y_T}\) are the feature vectors constructed from Li's first (approach=1) or Li's second (approach=2) approach with respect to series \(\boldsymbol X_T\) and \(\boldsymbol Y_T\), respectively and \(\boldsymbol A_{LPP}\) is the matrix of locality preserving projections whose columns are eigenvectors solving the generalized eigenvalue problem defined by matrix \(\boldsymbol S\).

References

weng2008classificationlppmlmts

Examples

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

Run the code above in your browser using DataLab