dtwPlotThreeWay(d,xts=NULL,yts=NULL,type.align="p",type.ts="l",
margin=4, inner.margin=0.2, title.margin=1.5,
xlab="Query index",ylab="Template index",main="Timeseries alignment",
... )
dtw
Only single-variate time series are supported, and
they must be passed to the x
and y
arguments (query and template are not stored
in the dtw
object).
## A noisy sine wave as query
## A cosine is for template; sin and cos are offset by 25 samples
idx<-seq(0,6.28,len=100);
query<-sin(idx)+runif(100)/10;
template<-cos(idx)
dtw(query,template,keep=TRUE)->alignment;
## Beware of the template's y axis, may be confusing
## Equivalent to plot(alignment,xts=query,yts=template,type="three");
dtwPlotThreeWay(alignment,xts=query,yts=template);
Run the code above in your browser using DataLab