diss.AR.MAH: Model-based Dissimilarity Proposed by Maharaj (1996, 2000)

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

View source: R/diss.R

Description

Computes the dissimilarity between two time series by testing whether both series are or not generated by the same ARMA model.

Usage

1
diss.AR.MAH(x, y, dependence=FALSE, permissive=TRUE)

Arguments

x

Numeric vector containing the first of the two time series.

y

Numeric vector containing the second of the two time series.

dependence

Boolean for considering dependence between observations of the series at the same point in time.

permissive

Boolean for continuing with the method even if no valid order is selected by AIC.

Details

Assuming that the time series x and y belong to the class of invertible and stationary ARMA processes, this dissimilarity measure is based on checking the equality of their underlying ARMA models by following the testing procedures proposed by Maharaj (1996,2000). The ARMA structures are approximated by truncated AR() models with a common order k = \max{(k_x, k_y)}, where k_x and k_y are determined by the AIC criterion. The AR coefficients are automatically fitted. The dissimilarity can be evaluated by using the value of the test statistic or alternatively the associated p-value. If dependence is FALSE, the dissimilarity measure is constructed by following the procedure introduced by Maharaj (1996), which is designed to compare independent time series. Otherwise, a more general testing procedure is used (Maharaj, 2000), which assumes that both models are correlated at the same time points but uncorrelated across observations (Maharaj, 2000). When permissive argument is TRUE, if the automatic fitting of the AR order fails, the method shows a warning and then forces an AR of order 1. If permissive is FALSE the method produces an error if no AR order is found by AIC.

Value

statistic

The statistic of the homogeneity test.

p_value

The p-value of the homogeneity test.

Author(s)

Pablo Montero Manso, José Antonio Vilar.

References

Maharaj, E.A. (1996) A significance test for classifying ARMA models. J. Statist. Comput. Simulation, 54(4), 305–331.

Maharaj E.A. (2000) Clusters of time series. J. Classification, 17(2), 297–314.

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.AR.PIC, diss.AR.LPC.CEPS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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.MAH(x, y)
diss.AR.MAH(x, z)
diss.AR.MAH(y, z)

#create a dist object for its use with clustering functions like pam or hclust
diss( rbind(x,y,z), "AR.MAH")$statistic

TSclust documentation built on July 23, 2020, 1:07 a.m.