dis_spectral | R Documentation |
dis_spectral
returns a pairwise distance matrix based on the
dissimilarities introduced by \insertCitekakizawa1998discrimination;textualmlmts.
dis_spectral(X, method = "j_divergence", alpha = 0.5, features = FALSE)
X |
A list of MTS (numerical matrices). |
method |
Parameter indicating the method to be used for the computation
of the distance. If |
alpha |
If |
features |
Logical. If |
Given a collection of MTS, the function returns a pairwise distance matrix. If method="j_divergence"
then the distance between two MTS \boldsymbol X_T
and \boldsymbol Y_T
is defined as
d_{JSPEC}(\boldsymbol X_T, \boldsymbol Y_T)=\frac{1}{2T}
\sum_{k=1}^{K}\bigg(tr\Big(\widehat{\boldsymbol f}_{\boldsymbol X_T}(\omega_k)
\widehat{\boldsymbol f}_{\boldsymbol Y_T}^{-1}(\omega_k)\Big)
+tr\Big(\widehat{\boldsymbol f}_{\boldsymbol Y_T}(\omega_k)
\widehat{\boldsymbol f}_{\boldsymbol X_T}^{-1}(\omega_k)\Big)-2d\bigg),
where \widehat{\boldsymbol f}_{\boldsymbol X_T}(\omega_k)
and
\widehat{\boldsymbol f}_{\boldsymbol Y_T}(\omega_k)
are the estimated
spectral density matrices from the series \boldsymbol X_T
and
\boldsymbol Y_T
, respectively, evaluated at frequency \omega_k
,
and tr(\cdot)
denotes the trace of a square matrix. If
method="chernoff_divergence"
, then the distance between two MTS
\boldsymbol X_T
and \boldsymbol Y_T
is defined as
d_{CSPEC}(\boldsymbol X_T, \boldsymbol Y_T)=
\frac{1}{2T}
\sum_{k=1}^{K}\bigg(\log{\frac{\Big|\alpha\widehat{\boldsymbol f}^{\boldsymbol X_T}(\omega_k)
+(1-\alpha)\widehat{\boldsymbol f}^{\boldsymbol Y_T}(\omega_k)\Big |}
{\Big|\widehat{\boldsymbol f}^{\boldsymbol Y_T}(\omega_k)\Big|}}+ \log{\frac{\Big|\alpha\widehat{\boldsymbol f}^{\boldsymbol Y_T}(\omega_k) +
(1-\alpha)\widehat{\boldsymbol f}^{\boldsymbol X_T}(\omega_k)\Big |}
{\Big|\widehat{\boldsymbol f}^{\boldsymbol X_T}(\omega_k)\Big|}}\bigg),
where \alpha \in (0,1)
.
If features = FALSE
(default), returns a distance matrix based on the distance
d_{JSPEC}
as long as we set method="j_divergence"
, and based on the alternative distance d_{CSPEC}
as long as we set method=
"chernoff_divergence"
.
Otherwise, if features = TRUE
, the function returns a dataset of feature vectors, i.e., each row in the dataset
contains the features employed to compute either d_{JSPEC}
or d_{CSPEC}
. These vectors
are vectorized versions of the estimated spectral matrices.
Ángel López-Oriona, José A. Vilar
kakizawa1998discriminationmlmts
toy_dataset <- Libras$data[1 : 10] # Selecting the first 10 MTS from the
# dataset Libras
distance_matrix_j <- dis_spectral(toy_dataset) # Computing the pairwise
# distance matrix based on the distance dis_jspec
distance_matrix_c <- dis_spectral(toy_dataset,
method = 'chernoff_divergence') # Computing the pairwise
# distance matrix based on the distance dis_cspec
feature_dataset <- dis_qcd(toy_dataset, features = TRUE) # Computing
# the corresponding dataset of features for d_cpec
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.