TSDatabaseDistances {TSdist}R Documentation

TSdist distance matrix computation.

Description

TSdist distance matrix computation for time series databases.

Usage

TSDatabaseDistances(X, Y=NULL, distance, ...)

Arguments

X

Time series database saved in a numeric matrix, a list, an mts object, a zoo object or xts object.

Y

Time series database saved in a numeric matrix, a list, an mts object, a zoo object or xts object. Should only be defined for calculation of distance matrices between two different databases so default value is NULL.

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", "wav", "int.per", "per", "mindist.sax", "ncd", "pred", "spec.glk", "spec.isd", "spec.llr", "pdc", "frechet", "tam")

f

...

Additional parameters required by the chosen distance measure.

Details

The distance matrix of a time series database is calculated by providing the pair-wise distances between the series that conform it. x can be saved in a numeric matrix, a list or a mts, 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. These parameters should be named in order to avoid mismatches.

Finally, for options dissim, dissimapprox and sts, databases conformed of series with different sampling rates can be introduced as a list of zoo, xts or ts objects, where each element in the list is a time series with its own time index.

Value

D

The computed distance matrix of the time series database. In some cases, such as ar.mahDistance or predDistance, some additional information is also provided.

Author(s)

Usue Mori, Alexander Mendiburu, Jose A. Lozano.

Examples


# The object example.database is a numeric matrix that saves
# 6 ARIMA time series in a row-wise format. For more information
# see help page of example.databases:

help(example.database)
data(example.database)

# To calculate the distance matrix of this database: 

TSDatabaseDistances(example.database, distance="manhattan")
TSDatabaseDistances(example.database, distance="edr", epsilon=0.2)
TSDatabaseDistances(example.database, distance="fourier", n=20)

# The object zoo.database is a zoo object that saves
# the same 6 ARIMA time series saved in example.database. 

data(zoo.database)

# To calculate the distance matrix of this database: 

TSDatabaseDistances(zoo.database, distance="manhattan")
TSDatabaseDistances(zoo.database, distance="edr", epsilon=0.2)
TSDatabaseDistances(zoo.database, distance="fourier", n=20)


[Package TSdist version 3.7.1 Index]