diss.ACF {TSclust} | R Documentation |
Autocorrelation-based Dissimilarity
Description
Computes the dissimilarity between two time series as the distance between their estimated simple (ACF) or partial (PACF) autocorrelation coefficients.
Usage
diss.ACF(x, y, p = NULL, omega=NULL, lag.max=50)
diss.PACF(x, y, p = NULL, omega=NULL, lag.max=50)
Arguments
x |
Numeric vector containing the first of the two time series. |
y |
Numeric vector containing the second of the two time series. |
p |
If not NULL, sets the weight for the geometric decaying of the autocorrelation coefficients. Ranging from |
lag.max |
Maximum number of simple or partial autocorrelation coefficients to be considered. |
omega |
If not NULL, completely specifies the weighting matrix for the autocorrelation coefficients. |
Details
Performs the weighted Euclidean distance between the simple autocorrelation ( dist.ACF
) or partial autocorrelation ( dist.PACF
) coefficients.
If neither p
nor omega
are specified, uniform weighting is used. If p
is specified, geometric wights decaying with the lag in the form p(1-p)^i
are applied. If omega
(\Omega
) is specified,
d(x,y) = {\{ ( \hat{\rho}_{x} - \hat{\rho}_{y} )^t \bm{\Omega} (\hat{\rho}_{x} - \hat{\rho}_{y} ) \}}^\frac{1}{2}
with \hat{\rho}_{x}
and \hat{\rho}_{y}
the respective (partial) autocorrelation coefficient vectors.
Value
The computed distance.
Author(s)
Pablo Montero Manso, José Antonio Vilar.
References
Galeano, P. and Peña, D. (2000). Multivariate analysis in vector time series. Resenhas, 4 (4), 383–403.
Montero, P and Vilar, J.A. (2014) TSclust: An R Package for Time Series Clustering. Journal of Statistical Software, 62(1), 1-43. http://www.jstatsoft.org/v62/i01/.
See Also
Examples
## Create three sample time series
x <- cumsum(rnorm(100))
y <- cumsum(rnorm(100))
z <- sin(seq(0, pi, length.out=100))
## Compute the distance and check for coherent results
diss.PACF(x, y)
diss.ACF(x, z)
diss.PACF(y, z)
#create a dist object for its use with clustering functions like pam or hclust
diss( rbind(x,y,z), "ACF", p=0.05)