Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/cran/dtw
28 September 2022, 07:50:27 UTC
  • Code
  • Branches (54)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/0.1-2
    • refs/tags/0.3-1
    • refs/tags/0.4-2
    • refs/tags/1.0-2
    • refs/tags/1.12-3
    • refs/tags/1.12-5
    • refs/tags/1.13-1
    • refs/tags/1.14-1
    • refs/tags/1.14-3
    • refs/tags/1.15
    • refs/tags/1.16
    • refs/tags/1.17-1
    • refs/tags/1.18-1
    • refs/tags/1.2-1
    • refs/tags/1.20-1
    • refs/tags/1.21-1
    • refs/tags/1.21-3
    • refs/tags/1.22-3
    • refs/tags/1.23-1
    • refs/tags/1.4-3
    • refs/tags/1.5-3
    • refs/tags/1.6-2
    • refs/tags/1.9-1
    • refs/tags/R-2.10.0
    • refs/tags/R-2.10.1
    • refs/tags/R-2.11.0
    • refs/tags/R-2.11.1
    • refs/tags/R-2.12.0
    • refs/tags/R-2.12.1
    • refs/tags/R-2.12.2
    • refs/tags/R-2.13.0
    • refs/tags/R-2.13.1
    • refs/tags/R-2.13.2
    • refs/tags/R-2.14.0
    • refs/tags/R-2.14.1
    • refs/tags/R-2.14.2
    • refs/tags/R-2.15.0
    • refs/tags/R-2.15.1
    • refs/tags/R-2.15.2
    • refs/tags/R-2.15.3
    • refs/tags/R-2.6.2
    • refs/tags/R-2.7.0
    • refs/tags/R-2.7.1
    • refs/tags/R-2.7.2
    • refs/tags/R-2.8.0
    • refs/tags/R-2.8.1
    • refs/tags/R-2.9.0
    • refs/tags/R-2.9.1
    • refs/tags/R-2.9.2
    • refs/tags/R-3.0.0
    • refs/tags/R-3.0.1
    • refs/tags/R-3.0.2
    • refs/tags/R-3.0.3
    No releases to show
  • 5f7f2f7
  • /
  • man
  • /
  • dtwPlot.Rd
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:385029d5c1d6863bd652ce2bb76bf57bde8fa293
origin badgedirectory badge Iframe embedding
swh:1:dir:ae2b92708697bf791cf6ce0bd1259829c7247b2d
origin badgerevision badge
swh:1:rev:7e56ce3aad7a130f3145baa08991cdcea6ce717b
origin badgesnapshot badge
swh:1:snp:e75a8a2617c9395688cff068aec5b1e7448d2a41
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 7e56ce3aad7a130f3145baa08991cdcea6ce717b authored by Toni Giorgino on 01 June 2008, 00:00:00 UTC
version 1.6-2
Tip revision: 7e56ce3
dtwPlot.Rd
\name{dtwPlot}
\alias{dtwPlot}
\alias{dtwPlotAlignment}
\alias{dtwPlotDensity}
\alias{plot.dtw}



%- Also NEED an '\alias' for EACH other topic documented here.
\title{Plotting of dynamic time warp results}
\description{
  Methods for plotting dynamic time warp alignment objects returned
  by \code{\link{dtw}}.
}
\usage{

\method{plot}{dtw}(x, type="alignment", ...)

# an alias for dtw.plot
dtwPlot(x, type="alignment", ...)

dtwPlotAlignment(d, xlab="Query index", ylab="Template index", ...)
dtwPlotDensity(d, normalize="no",
		  xlab="Query index", ylab="Template index",
                  ...)


}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{x,d}{ \code{dtw} object, usually result of call to \code{\link{dtw}}}
  \item{xlab}{ label for the query axis}
  \item{ylab}{label for the template axis}
  \item{type}{alignment plot style}
  \item{normalize}{show per-step average cost instead of cumulative cost}
  
  \item{...}{additional arguments, passed to plotting functions}
}

\details{

  \code{dtwPlot} displays  alignment contained in \code{dtw} objects.

  Various plotting styles are available, passing strings to the
  \code{type} argument (may be abbreviated):

  \itemize{
    \item{\code{alignment}}{plot of the warping curve (may be
      multi-valued unless the \code{asymmetric}-like step pattern is used)}
    \item{\code{twoway}}{Point-by-point comparison with matching lines}
    \item{\code{threeway}}{vis-a-vis visual inspection of the
       original timeseries and their alignment }
    \item{\code{density}}{show the cumulative cost landscape with the
      warping path overimposed}
  }

  
  For two-way plotting, see documentation for function
  \code{\link{dtwPlotTwoWay}}.

  For three-way plotting, see documentation for function
  \code{\link{dtwPlotThreeWay}}.


  \code{normalize} can be one of \code{"N"} of \code{"N+M"}.  If set,
  \emph{average} cost per step is plotted instead of the cumulative
  one. Step averaging depends on the step pattern chosen. \code{N} is
  suitable for asymmetric patterns and divides the distance by the index
  in query; \code{N+M} is for (normalizable) symmetric patterns, and
  divides by the Manhattan distance from the origin.
  
  Additional  parameters are carried on to the plotting
  functions: use with care.

}


\note{
  The density plot is more colorful than useful.
  }

\section{Warning}{ These functions are incompatible with mechanisms for
     arranging plots on a device: \code{par(mfrow)}, \code{layout} and
     \code{split.screen}.}

\author{Toni Giorgino }

\seealso{
  \code{\link{dtwPlotTwoWay}} for details on  two-way plotting function.
  \code{\link{dtwPlotThreeWay}} for details on  three-way plotting function.
}


\examples{
## Same example as in dtw

idx<-seq(0,6.28,len=100);
query<-sin(idx)+runif(100)/10;
template<-cos(idx)

alignment<-dtw(query,template,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,template,keep=TRUE,step=asymmetricItakura)->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,template,keep=TRUE,window=itakuraWindow)->ita;
dtwPlot(ita,type="density",
        main="Symmetric step with Itakura parallelogram window")


}

\concept{Dynamic Time Warp}
\concept{Warping function}


\keyword{ ts }
\keyword{ hplot }

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API