importance_ls_cpp | R Documentation |
Computes the contribution of individual variables to the similarity/dissimilarity between two aligned multivariate time series. This function generates a data frame with the following columns:
variable: name of the individual variable for which the importance
is being computed, from the column names of the arguments x
and y
.
psi: global dissimilarity score psi
of the two time series.
psi_only_with: dissimilarity between x
and y
computed from the given variable alone.
psi_without: dissimilarity between x
and y
computed from all other variables.
psi_difference: difference between psi_only_with
and psi_without
.
importance: contribution of the variable to the similarity/dissimilarity
between x
and y
, computed as (psi_difference * 100) / psi_all
.
Positive scores represent contribution to dissimilarity,
while negative scores represent contribution to similarity.
importance_ls_cpp(x, y, distance = "euclidean")
x |
(required, numeric matrix) multivariate time series. |
y |
(required, numeric matrix) multivariate time series with the same number of columns and rows as 'x'. |
distance |
(optional, character string) distance name from the "names"
column of the dataset |
data frame
Other Rcpp_importance:
importance_dtw_cpp()
,
importance_dtw_legacy_cpp()
#simulate two regular time series
x <- zoo_simulate(
seed = 1,
irregular = FALSE
)
y <- zoo_simulate(
seed = 2,
irregular = FALSE
)
#same number of rows
nrow(x) == nrow(y)
#compute importance
df <- importance_ls_cpp(
x = x,
y = y,
distance = "euclidean"
)
df
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.