Learn R Programming

fdars (version 0.3.3)

metric.DTW: Dynamic Time Warping for Functional Data

Description

Computes the Dynamic Time Warping distance between functional data. DTW allows for non-linear alignment of curves.

Usage

metric.DTW(fdataobj, fdataref = NULL, p = 2, w = NULL, ...)

Value

A distance matrix.

Arguments

fdataobj

An object of class 'fdata'.

fdataref

An object of class 'fdata'. If NULL, computes self-distances.

p

The p in Lp distance (default 2 for L2/Euclidean).

w

Sakoe-Chiba window constraint. Default is min(ncol(fdataobj), ncol(fdataref)). Use -1 for no window constraint.

...

Additional arguments (ignored).

Examples

Run this code
fd <- fdata(matrix(rnorm(100), 10, 10))
D <- metric.DTW(fd)

Run the code above in your browser using DataLab