diss.ACF | R Documentation |
Computes the dissimilarity between two time series as the distance between their estimated simple (ACF) or partial (PACF) autocorrelation coefficients.
diss.ACF(x, y, p = NULL, omega=NULL, lag.max=50)
diss.PACF(x, y, p = NULL, omega=NULL, lag.max=50)
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. |
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.
The computed distance.
Pablo Montero Manso, José Antonio Vilar.
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.18637/jss.v062.i01")}
diss.COR
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.