dis_qcf {mlmts}R Documentation

Constructs a pairwise distance matrix based on the quantile cross-covariance function

Description

dis_qcf returns a pairwise distance matrix based on a generalization of the dissimilarity introduced by Lafuente-Rego and Vilar (2016).

Usage

dis_qcf(X, levels = c(0.1, 0.5, 0.9), max_lag = 1, features = FALSE)

Arguments

X

A list of MTS (numerical matrices).

levels

The set of probability levels.

max_lag

The maximum lag considered to compute the cross-covariances.

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_{QCF}(\boldsymbol X_T, \boldsymbol Y_T)=\Bigg(\sum_{l=1}^{L}\sum_{i=1}^{r}\sum_{i'=1}^{r}\sum_{j_1=1}^{d} \sum_{j_2=1}^{d}\bigg(\widehat \gamma_{j_1,j_2}^{\boldsymbol X_T}(l,\tau_i,\tau_{i^\prime})-\widehat \gamma_{j_1,j_2}^{\boldsymbol Y_T} (l,\tau_i,\tau_{i^\prime})\bigg)^2+

\sum_{i=1}^{r}\sum_{i'=1}^{r}\sum_{{j_1,j_2=1: j_1 > j_2}}^{d} \bigg(\widehat \gamma_{j_1,j_2}^{\boldsymbol X_T}(0,\tau_i,\tau_{i^\prime})- \widehat \gamma_{j_1,j_2}^{\boldsymbol Y_T}(0,\tau_i,\tau_{i^\prime})\bigg)^2\Bigg]^{1/2},

where \widehat \gamma_{j_1,j_2}^{\boldsymbol X_T}(l,\tau_i,\tau_{i^\prime}) and \widehat \gamma_{j_1,j_2}^{\boldsymbol Y_T}(l,\tau_i,\tau_{i^\prime}) are estimates of the quantile cross-covariances with respect to the variables j_1 and j_2 and probability levels \tau_i and \tau_{i^\prime} for series \boldsymbol X_T and \boldsymbol Y_T, respectively.

Value

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

Author(s)

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

References

Lafuente-Rego B, Vilar JA (2016). “Clustering of time series using quantile autocovariances.” Advances in Data Analysis and classification, 10(3), 391–415.

See Also

dis_qcd

Examples

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

[Package mlmts version 1.1.1 Index]