Learn R Programming

TSclust (version 1.1)

diss.AR.PIC: Model-based Dissimilarity Measure Proposed by Piccolo (1990)

Description

Computes the distance between two time series as the Euclidean distance between the truncated AR operators approximating their ARMA structures.

Usage

diss.AR.PIC(x, y, order=NULL)
multidiss.AR.PIC( series, order=NULL)

Arguments

x
Numeric vector containing the first of the two time series.
y
Numeric vector containing the second of the two time series.
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 corresponding series are fitted automatically imposing an AR model, selected automatically by AIC. multidiss.AR.PIC computes the similarity matrix for more that two series having different orders.

References

Piccolo, D. (1990) A distance measure for classifying arima models. J. Time Series Anal., 11(2), 153--164.

See Also

diss.AR.MAH diss.AR.LPC.CEPS

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.PIC(x, y, rbind( c(2,0,0), c(1,0,0)) ) #ARIMA(2,0,0) for x and ARIMA(1,0,0) for y
diss.AR.PIC(x, z, rbind( c(2,0,0), c(2,0,0)) )
# AR for y (automatically selected) and ARIMA(2,0,0) for z
diss.AR.PIC(y, z, rbind( c(NA,NA,NA), c(2,0,0)) ) 
#create a dist object for its use with clustering functions like pam or hclust
multidiss.AR.PIC( rbind(x,y,z), order=rbind(c(2,0,0), c(1,0,0), c(2,0,0)) )

Run the code above in your browser using DataLab