Description Usage Arguments Details Warning Note Author(s) See Also Examples
Methods for plotting dynamic time warp alignment objects returned
by dtw.
1 2 3 4 5 6 7 8 9 10 11 |
x,d |
|
xlab |
label for the query axis |
ylab |
label for the reference axis |
type |
general style for the alignment plot |
plot.type |
type of line to be drawn, used as the |
normalize |
show per-step average cost instead of cumulative cost |
... |
additional arguments, passed to plotting functions |
dtwPlot displays alignment contained in dtw objects.
Various plotting styles are available, passing strings to the
type argument (may be abbreviated):
alignmentplots the warping curve in d
twowayplots a point-by-point comparison, with matching lines
threewayvis-a-vis inspection of the
timeseries and their warping curve
densitydisplays the cumulative cost landscape with the
warping path overimposed
For two-way plotting, see documentation for function
dtwPlotTwoWay.
For three-way plotting, see documentation for function
dtwPlotThreeWay.
If normalize is TRUE, the average cost per step
is plotted instead of the cumulative one. Step averaging depends on
the stepPattern used.
Additional parameters are carried on to the plotting functions: use with care.
These functions are incompatible with mechanisms for
arranging plots on a device: par(mfrow), layout and
split.screen.
The density plot is more colorful than useful.
Toni Giorgino
dtwPlotTwoWay for details on two-way plotting function.
dtwPlotThreeWay for details on three-way plotting function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ## Same example as in dtw
idx<-seq(0,6.28,len=100);
query<-sin(idx)+runif(100)/10;
reference<-cos(idx)
alignment<-dtw(query,reference,keep=TRUE);
## A profile of the cumulative distance matrix
## Contour plot of the global cost
dtwPlotDensity(alignment,
main="Sine/cosine: symmetric alignment, no constraints")
######
##
## A study of the "Itakura" parallelogram
##
## A widely held misconception is that the "Itakura parallelogram" (as
## described in the original article) is a global constraint. Instead,
## it arises from local slope restrictions. Anyway, an "itakuraWindow",
## is provided in this package. A comparison between the two follows.
## The local constraint: three sides of the parallelogram are seen
dtw(query,reference,keep=TRUE,step=typeIIIc)->ita;
dtwPlot(ita,type="density",
main="Slope-limited asymmetric step (Itakura)")
## Symmetric step with global parallelogram-shaped constraint. Note how
## long (>2 steps) horizontal stretches are allowed within the window.
dtw(query,reference,keep=TRUE,window=itakuraWindow)->ita;
dtwPlot(ita,type="density",
main="Symmetric step with Itakura parallelogram window")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.