% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/distantia_dtw.R
\name{distantia_dtw}
\alias{distantia_dtw}
\title{Dynamic Time Warping Dissimilarity Analysis of Time Series Lists}
\usage{
distantia_dtw(tsl = NULL, distance = "euclidean", bandwidth = 1)
}
\arguments{
\item{tsl}{(required, time series list) list of zoo time series. Default: NULL}

\item{distance}{(optional, character vector) name or abbreviation of the distance method. Valid values are in the columns "names" and "abbreviation" of the dataset \link{distances}. Default: "euclidean".}

\item{bandwidth}{(optional, numeric) Proportion of space at each side of the cost matrix diagonal (aka \emph{Sakoe-Chiba band}) defining a valid region for dynamic time warping, used to control the flexibility of the warping path. This method prevents degenerate alignments due to differences in magnitude between time series when the data is not properly scaled. If \code{1} (default), DTW is unconstrained. If \code{0}, DTW is fully constrained and the warping path follows the matrix diagonal. Recommended values may vary depending on the nature of the data. Ignored if \code{lock_step = TRUE}. Default: 1.}
}
\value{
data frame with columns:
\itemize{
\item \code{x}: time series name.
\item \code{y}: time series name.
\item \code{distance}: name of the distance metric.
\item \code{psi}: psi dissimilarity of the sequences \code{x} and \code{y}.
}
}
\description{
A minimalistic but slightly faster version of \code{\link[=distantia]{distantia()}} that computes dynamic time warping dissimilarity scores using diagonal least cost paths.
}
\examples{

#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"
  )

}


}
\seealso{
Other distantia:
\code{\link[=distantia]{distantia()}},
\code{\link[=distantia_dtw_plot]{distantia_dtw_plot()}},
\code{\link[=distantia_ls]{distantia_ls()}}
}
\concept{distantia}
