TSDistances(x, y, tx, ty, distance, ...)ts, zoo or xts object containing the first time series.
ts, zoo or xts object containing the second time series.
x. Only necessary if x is a numeric vector and the sampling index is not constant.
y. Only necessary if y is a numeric vector and the sampling index is not constant.
"euclidean", "manhattan", "minkowski", "infnorm", "ccor", "sts", "dtw", "keogh.lb", "edr", "erp", "lcss", "fourier", "tquest", "dissim", "acf", "pacf", "ar.lpc.ceps", "ar.mah", "ar.mah.statistic", "ar.mah.pvalue", "ar.pic", "cdm", "cid", "cor", "cort", "wav", "int.per", "per", "mindist.sax", "ncd", "pred", "spec.glk", "spec.isd",
"spec.llr", "pdc", "frechet")
The distance between the two time series x and y is calculated. x and y can be saved in a numeric vector or a ts, zoo or xts object. The following distance methods are supported:
EuclideanDistance
ManhattanDistance
MinkowskiDistance
InfNormDistance
CCorDistance
STSDistance
DTWDistance. Uses the dtw package (see dtw).
LBKeoghDistance
EDRDistance
ERPDistance
LCSSDistance
FourierDistance
TquestDistance
DissimDistance
ACFDistance. Uses the TSclust package (see diss.ACF).
PACFDistance. Uses the TSclust package (see diss.PACF).
ARLPCCepsDistance. Uses the TSclust package (see diss.AR.LPC.CEPS).
ARMahDistance. Uses the TSclust package (see diss.AR.MAH).
ARPicDistance. Uses the TSclust package (see diss.AR.PIC).
CDMDistance. Uses the TSclust package (see diss.CDM).
CIDDistance. Uses the TSclust package (see diss.CID).
CorDistance. Uses the TSclust package (see diss.COR).
CortDistance. Uses the TSclust package (see diss.CORT).
WavDistance. Uses the TSclust package (see diss.DWT).
IntPerDistance. Uses the TSclust package (see diss.INT.PER).
PerDistance. Uses the TSclust package (see diss.PER).
MindistSaxDistance. Uses the TSclust package (see diss.MINDIST.SAX).
NCDDistance. Uses the TSclust package (see diss.NCD).
PredDistance. Uses the TSclust package (see diss.PRED).
SpecGLKDistance. Uses the TSclust package (see diss.SPEC.GLK).
SpecISDDistance. Uses the TSclust package (see diss.SPEC.ISD).
SpecLLRDistance. Uses the TSclust package (see diss.SPEC.LLR).
PDCDistance. Uses the pdc package (see pdcDist).
FrechetDistance. Uses the longitudinalData package (see distFrechet).
Some distance measures may require additional arguments. See the individual help pages (detailed above) for more information about each method.
# The objects zoo.series1 and zoo.series2 are two
# zoo objects that save two series of length 100.
data(zoo.series1)
data(zoo.series2)
# For information on their generation and shape see
# help page of example.series.
help(example.series)
# The distance calculation for these two series is done
# as follows:
TSDistances(zoo.series1, zoo.series2, distance="infnorm")
TSDistances(zoo.series1, zoo.series2, distance="cor", beta=3)
TSDistances(zoo.series1, zoo.series2, distance="dtw", sigma=20)
Run the code above in your browser using DataLab