dis_cor | R Documentation |
dis_cor
returns a pairwise distance matrix based on a generalization of the
dissimilarity introduced by \insertCited2009autocorrelation;textualmlmts.
dis_cor(X, lag_max = 1, features = FALSE)
X |
A list of MTS (numerical matrices). |
lag_max |
The maximum lag considered to compute the auto and cross-correlations. |
features |
Logical. If |
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_{COR}(\boldsymbol X_T, \boldsymbol Y_T)=\Big|||\widehat{\boldsymbol \theta}^{\boldsymbol X_T}_{AC}-
\widehat{\boldsymbol \theta}^{\boldsymbol Y_T}_{AC}||^2+||\widehat{\boldsymbol \theta}^{\boldsymbol X_T}_{CC}-
\widehat{\boldsymbol \theta}^{\boldsymbol Y_T}_{CC}||^2\Big|^{1/2},
where \widehat{\boldsymbol \theta}^{\boldsymbol X_T}_{AC}
and \widehat{\boldsymbol \theta}^{\boldsymbol Y_T}_{AC}
are vectors
containing the estimated autocorrelations within \boldsymbol X_T
and \boldsymbol Y_T
, respectively, and
\widehat{\boldsymbol \theta}^{\boldsymbol X_T}_{CC}
and \widehat{\boldsymbol \theta}^{\boldsymbol Y_T}_{CC}
are vectors
containing the estimated cross-correlations within \boldsymbol X_T
and \boldsymbol Y_T
, respectively.
If features = FALSE
(default), returns a distance matrix based on the distance d_{COR}
. 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_{COR}
.
Ángel López-Oriona, José A. Vilar
d2009autocorrelationmlmts
toy_dataset <- AtrialFibrillation$data[1 : 10] # Selecting the first 10 MTS from the
# dataset AtrialFibrillation
distance_matrix <- dis_cor(toy_dataset) # Computing the pairwise
# distance matrix based on the distance dis_cor
distance_matrix <- dis_cor(toy_dataset, lag_max = 5) # Considering
# auto and cross-correlations up to lag 5 in the computation of the distance
feature_dataset <- dis_cor(toy_dataset, features = TRUE) # Computing
# the corresponding dataset of features
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.