TSDistances {TSdist} | R Documentation |
TSdist distance computation.
Description
TSdist distance calculation between two time series.
Usage
TSDistances(x, y, tx, ty, distance, ...)
Arguments
x |
Numeric vector or |
y |
Numeric vector or |
tx |
Optional temporal index of series |
ty |
Optional temporal index of series |
distance |
Distance measure to be used. It must be one of: |
... |
Additional parameters required by the distance method. |
Details
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:
"euclidean": Euclidean distance.
EuclideanDistance
"manhattan": Manhattan distance.
ManhattanDistance
"minkowski": Minkowski distance.
MinkowskiDistance
"infnorm": Infinite norm distance.
InfNormDistance
"ccor": Distance based on the cross-correlation.
CCorDistance
"sts": Short time series distance.
STSDistance
"dtw": Dynamic Time Warping distance.
DTWDistance
. Uses the dtw package (seedtw
)."lb.keogh": LB_Keogh lower bound for the Dynamic Time Warping distance.
LBKeoghDistance
"edr": Edit distance for real sequences.
EDRDistance
"erp": Edit distance with real penalty.
ERPDistance
"lcss": Longest Common Subsequence Matching.
LCSSDistance
"fourier": Distance based on the Fourier Discrete Transform.
FourierDistance
"tquest": TQuest distance.
TquestDistance
"dissim": Dissim distance.
DissimDistance
"acf": Autocorrelation-based dissimilarity
ACFDistance
. Uses the TSclust package (seediss.ACF
)."pacf": Partial autocorrelation-based dissimilarity
PACFDistance
. Uses the TSclust package (seediss.PACF
)."ar.lpc.ceps": Dissimilarity based on LPC cepstral coefficients
ARLPCCepsDistance
. Uses the TSclust package (seediss.AR.LPC.CEPS
)."ar.mah": Model-based dissimilarity proposed by Maharaj (1996, 2000)
ARMahDistance
. Uses the TSclust package (seediss.AR.MAH
)."ar.pic": Model-based dissimilarity measure proposed by Piccolo (1990)
ARPicDistance
. Uses the TSclust package (seediss.AR.PIC
)."cdm": Compression-based dissimilarity measure
CDMDistance
. Uses the TSclust package (seediss.CDM
)."cid": Complexity-invariant distance measure
CIDDistance
. Uses the TSclust package (seediss.CID
)."cor": Dissimilarities based on Pearson's correlation
CorDistance
. Uses the TSclust package (seediss.COR
)."cort": Dissimilarity index which combines temporal correlation and raw value behaviors
CortDistance
. Uses the TSclust package (seediss.CORT
)."int.per": Integrated periodogram based dissimilarity
IntPerDistance
. Uses the TSclust package (seediss.INT.PER
)."per": Periodogram based dissimilarity
PerDistance
. Uses the TSclust package (seediss.PER
)."mindist.sax": Symbolic Aggregate Aproximation based dissimilarity
MindistSaxDistance
. Uses the TSclust package (seediss.MINDIST.SAX
)."ncd": Normalized compression based distance
NCDDistance
. Uses the TSclust package (seediss.NCD
)."pred": Dissimilarity measure cased on nonparametric forecasts
PredDistance
. Uses the TSclust package (seediss.PRED
)."spec.glk": Dissimilarity based on the generalized likelihood ratio test
SpecGLKDistance
. Uses the TSclust package (seediss.SPEC.GLK
)."spec.isd": Dissimilarity based on the integrated squared difference between the log-spectra
SpecISDDistance
. Uses the TSclust package (seediss.SPEC.ISD
)."spec.llr": General spectral dissimilarity measure using local-linear estimation of the log-spectra
SpecLLRDistance
. Uses the TSclust package (seediss.SPEC.LLR
)."pdc": Permutation Distribution Distance
PDCDistance
. Uses the pdc package (seepdcDist
)."frechet": Frechet distance
FrechetDistance
. Uses the longitudinalData package (seedistFrechet
)."tam": Time Aligment Measurement
TAMDistance
.
Some distance measures may require additional arguments. See the individual help pages (detailed above) for more information about each method.
Value
d |
The computed distance between the pair of time series. |
Author(s)
Usue Mori, Alexander Mendiburu, Jose A. Lozano.
Examples
# 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)