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",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:
EuclideanDistanceManhattanDistanceMinkowskiDistanceInfNormDistanceCCorDistanceSTSDistanceDTWDistance. Uses thedtw).LBKeoghDistanceEDRDistanceERPDistanceLCSSDistanceFourierDistanceTquestDistanceDissimDistanceACFDistance. Uses thediss.ACF).PACFDistance. Uses thediss.PACF).ARLPCCepsDistance. Uses thediss.AR.LPC.CEPS).ARMahDistance. Uses thediss.AR.MAH).ARPicDistance. Uses thediss.AR.PIC).CDMDistance. Uses thediss.CDM).CIDDistance. Uses thediss.CID).CorDistance. Uses thediss.COR).CortDistance. Uses thediss.CORT).WavDistance. Uses thediss.DWT).IntPerDistance. Uses thediss.INT.PER).PerDistance. Uses thediss.PER).MindistSaxDistance. Uses thediss.MINDIST.SAX).NCDDistance. Uses thediss.NCD).PredDistance. Uses thediss.PRED).SpecGLKDistance. Uses thediss.SPEC.GLK).SpecISDDistance. Uses thediss.SPEC.ISD).SpecLLRDistance. Uses thediss.SPEC.LLR).PDCDistance. Uses thepdcDist).FrechetDistance. Uses thedistFrechet).# 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