Learn R Programming

TSclust (version 1.1)

diss.AR.LPC.CEPS: Dissimilarity Based on LPC Cepstral Coefficients

Description

Computes the dissimilarity between two time series in terms of their Linear Predicitive Coding (LPC) ARMA processes.

Usage

diss.AR.LPC.CEPS(x, y, k = 50, order=NULL,
 seasonal=list(list(order=c(0, 0, 0), period=NA), list(order=c(0, 0, 0), period=NA)))

multidiss.AR.LPC.CEPS(series, k = 50, order=NULL, seasonal=NULL )

Arguments

x
Numeric vector containing the first of the two time series.
y
Numeric vector containing the second of the two time series.
k
Number of cepstral coefficients to be considered.
seasonal
A list of arima seasonal elements.
order
Numeric matrix. Each row specifies the ARIMA models to be fitted for the series.
series
Numeric matrix. Each row specifies one time series.

Value

  • The computed distance.

Details

Each row of order contains the three components of the ARIMA model: the AR order, the degree of differencing and the MA order, specified as in the function arima. The first two rows correspond to series x and y respectively. If order is NULL, or any of the orders contains NA values, the series are automatically fitted by imposing an AR model, selected by AIC. Each element of seasonal is a list with two components: 'order' and 'period'. See seasonal parameter of arima. The seasonal component of a series is ignored if the order component is not specified. multidiss.AR.LPC.CEPST computes the similarity matrix for more that two series having different orders.

References

Kalpakis, K., Gada D. and Puttagunta, V. (2001) Distance measures for effective clustering of arima time-series. Proceedings 2001 IEEE International Conference on Data Mining, 273--280.

See Also

link{diss.AR.PIC}, link{diss.AR.MAH}

Examples

Run this code
## Create three sample time series
x <- arima.sim(model=list(ar=c(0.4,-0.1)), n =100, n.start=100)
y <- arima.sim(model=list(ar=c(0.9)), n =100, n.start=100)
z <- arima.sim(model=list(ar=c(0.5, 0.2)), n =100, n.start=100)
## Compute the distance and check for coherent results
diss.AR.LPC.CEPS(x, y, 25) #impose an AR automatically selected for both series
#impose an ARIMA(2,0,0) for series x and an AR automatically selected for z
diss.AR.LPC.CEPS(x, z, 25, order = rbind( c(2,0,0) , c(NA,NA,NA)) ) 
diss.AR.LPC.CEPS(y, z, 25)
#create a dist object for its use with clustering functions like pam or hclust

multidiss.AR.LPC.CEPS( rbind(x,y,z), k=20, order=rbind(c(2,0,0), c(1,0,0), c(2,0,0)),
 list( list(order=c(1,0,0), period=1), list(order=c(2,0,0), period=3),
  list(order=c(1,0,0), period=1)) )

Run the code above in your browser using DataLab