diss.ACF: Autocorrelation-based Dissimilarity

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/diss.R

Description

Computes the dissimilarity between two time series as the distance between their estimated simple (ACF) or partial (PACF) autocorrelation coefficients.

Usage

1
2
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 0 to 1.

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. p is ignored if omega is used.

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 (Ω) is specified,

d(x,y) = ((ρ_x - ρ_y)^t Ω (ρ_x - ρ_y) )^0.5

with ρ_x and ρ_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

diss.COR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)

TSclust documentation built on Nov. 17, 2017, 7:24 a.m.