View source: R/distantia_dtw.R
distantia_dtw | R Documentation |
Minimalistic but slightly faster version of distantia()
to compute dynamic time warping dissimilarity scores using diagonal least cost paths.
distantia_dtw(tsl = NULL, distance = "euclidean")
tsl |
(required, time series list) list of zoo time series. Default: NULL |
distance |
(optional, character vector) name or abbreviation of the distance method. Valid values are in the columns "names" and "abbreviation" of the dataset distances. Default: "euclidean". |
data frame with columns:
x
: time series name.
y
: time series name.
distance
: name of the distance metric.
psi
: psi dissimilarity of the sequences x
and y
.
Other distantia:
distantia()
,
distantia_dtw_plot()
,
distantia_ls()
#load fagus_dynamics as tsl
#global centering and scaling
tsl <- tsl_initialize(
x = fagus_dynamics,
name_column = "name",
time_column = "time"
) |>
tsl_transform(
f = f_scale_global
)
if(interactive()){
tsl_plot(
tsl = tsl,
guide_columns = 3
)
}
#dynamic time warping dissimilarity analysis
df_dtw <- distantia_dtw(
tsl = tsl,
distance = "euclidean"
)
df_dtw[, c("x", "y", "psi")]
#visualize dynamic time warping
if(interactive()){
distantia_dtw_plot(
tsl = tsl[c("Spain", "Sweden")],
distance = "euclidean"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.