Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

warpArea

Compute Warping Path Area


Description

Compute the area between the warping function and the diagonal (no-warping) path, in unit steps.

Usage

warpArea(d)

Arguments

d

an object of class dtw

Details

Above- and below- diagonal unit areas all count plus one (they do not cancel with each other). The "diagonal" goes from one corner to the other of the possibly rectangular cost matrix, therefore having a slope of M/N, not 1, as in slantedBandWindow().

The computation is approximate: points having multiple correspondences are averaged, and points without a match are interpolated. Therefore, the area can be fractionary.

Value

The area, not normalized by path length or else.

Note

There could be alternative definitions to the area, including considering the envelope of the path.

Author(s)

Toni Giorgino

Examples

ds<-dtw(1:4,1:8);

  plot(ds);lines(seq(1,8,len=4),col="red");

  warpArea(ds)

  ## Result: 6
  ##  index 2 is 2 while diag is 3.3  (+1.3)
  ##        3    3               5.7  (+2.7)
  ##        4   4:8 (avg to 6)    8   (+2  )
  ##                                 --------
  ##                                     6

dtw

Dynamic Time Warping Algorithms

v1.22-3
GPL (>= 2)
Authors
Toni Giorgino [aut, cre]
Initial release
2020-9-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.