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 ts, zoo or xts object containing the first time series.

y

Numeric vector or ts, zoo or xts object containing the second time series.

tx

Optional temporal index of series x. Only necessary if x is a numeric vector and the sampling index is not constant.

ty

Optional temporal index of series y. Only necessary if y is a numeric vector and the sampling index is not constant.

distance

Distance measure to be used. It must be one of: "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", "int.per", "per", "mindist.sax", "ncd", "pred", "spec.glk", "spec.isd", "spec.llr", "pdc", "frechet","tam")

...

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:

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)




[Package TSdist version 3.7.1 Index]