Clustering algorithm based on p-values. Each group in the cluster solution is formed by series with associated p-values greater than a pre-specified level of significance.
pvalues.clust(pvalues, significance)
An integer vector of length n, the number of observations, giving for each observation the number (id) of the cluster to which it belongs.
A dist
object containing the p-values from testing the equality of each pair of time series under study.
The significance level.
Pablo Montero Manso, José Antonio Vilar.
Each element (i,j) in pvalues
corresponds to the p-value obtained from checking whether or not the diss.AR.MAH
(see Maharaj, 2000), but it can be applied to any similar test.
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. tools:::Rd_expr_doi("doi:10.18637/jss.v062.i01")
diss.AR.MAH
## 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
dd <- diss( rbind(x,y,z), "AR.MAH")
pvalues.clust( dd$p_value, 0.05 )
Run the code above in your browser using DataLab