countPaths: Count the number of possible warping paths

Description Usage Arguments Details Value Author(s) Examples

View source: R/countPaths.R

Description

Count the number of warping paths compatible with the constraints.

Usage

1

Arguments

d

an object of class dtw

debug

return an intermediate result

Details

Count how many possible warping paths exist in the alignment problem passed as an argument. The object passed as an argument is used to look up the problem parameters such as the used step pattern, windowing, open ends, and so on. The actual alignment is ignored.

Note that the number of paths grows exponentially with problems size. The result may be approximate when windowing functions are used.

If debug is TRUE, a matrix used for the computation is returned instead of the final result.

Value

The number of paths.

Author(s)

Toni Giorgino

Examples

1
2
3
  ds<-dtw(1:7+2,1:8,keep=TRUE,step=asymmetric);
  countPaths(ds)
  ## Result: 126

Example output

Loading required package: proxy

Attaching package: 'proxy'

The following objects are masked from 'package:stats':

    as.dist, dist

The following object is masked from 'package:base':

    as.matrix

Loaded dtw v1.20-1. See ?dtw for help, citation("dtw") for use in publication.

[1] 126

dtw documentation built on May 2, 2019, 5:55 p.m.