Computes distances time warping for functional data
Arguments
- fdata1
Functional data 1 or curve 1. If
fdata
class, the dimension offdata1$data
object is (n1
xm
), wheren1
is the number of curves andm
are the points observed in each curve.- fdata2
Functional data 2 or curve 2. If
fdata
class, the dimension offdata2$data
object is (n2
xm
), wheren2
is the number of curves andm
are the points observed in each curve.- p
Lp norm, by default it uses
p = 2
- w
Vector of weights with length
m
, Ifw = 1
approximates the metric Lp by Simpson's rule. By default it usesw = 1
- wmax
numeric
maximum value of weight, (1 by default)- g
numeric
g=0
(constant),0.05
(linear) by default, 0.25sigmoid
, 3 two weight values- lambda
numeric
lambda value (0 by default)- nu
numeric
constant value, (0 by default)
References
Jeong, Y. S., Jeong, M. K., & Omitaomu, O. A. (2011). Weighted dynamic time warping for time series classification. Pattern Recognition, 44(9), 2231-2240
See also
See also semimetric.basis
and semimetric.NPFDA
Author
Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@udc.es
Examples
if (FALSE) { # \dontrun{
data(tecator)
metric.DTW(tecator$absorp.fdata[1:4,])
ab=tecator[[1]]
D1=fda.usc:::DTW(ab$data[1,],ab$data[2,],p=2)
aa1=fda.usc:::findPath(D1$D)
D2=fda.usc:::DTW(ab$data[1,],ab$data[2,],p=2,w=5)
aa2=fda.usc:::findPath(D2$D)
D3=fda.usc:::WDTW(ab$data[1,],ab$data[2,],p=2,g=0.05)
aa3=fda.usc:::findPath(D3$D)
D4=fda.usc:::TWED(ab$data[1,],ab$data[2,],p=2,lambda=0,nu=0)
aa4=fda.usc:::findPath(D4$D)
par(mfrow=c(2,2))
plot(c(ab[1:2]))
segments(ab$argvals[aa1[,1]],ab[1]$data[aa1[,1]],ab$argvals[aa1[,2]],ab[2]$data[aa1[,2]])
plot(c(ab[1:2]))
segments(ab$argvals[aa2[,1]],ab[1]$data[aa2[,1]],ab$argvals[aa2[,2]],ab[2]$data[aa2[,2]],col=2)
plot(c(ab[1:2]))
segments(ab$argvals[aa3[,1]],ab[1]$data[aa3[,1]],ab$argvals[aa3[,2]],ab[2]$data[aa3[,2]],col=3)
plot(c(ab[1:2]))
segments(ab$argvals[aa4[,1]],ab[1]$data[aa4[,1]],ab$argvals[aa4[,2]],ab[2]$data[aa4[,2]],col=4)
} # }