This function computes and returns the distance matrix computed by the divergence between permutation distributions of time series.

pdcDist(X, m = NULL, t = NULL, divergence = symmetricAlphaDivergence)

Arguments

X

A matrix representing a set of time series. Columns are time series and rows represent time points.

m

Embedding dimension for calculating the permutation distributions. Reasonable values range usually somewhere between 2 and 10. If no embedding dimension is chosen, the MinE heuristic is used to determine the embedding dimension automatically.

t

Time-delay of the embedding

divergence

Divergence measure between discrete distributions. Default is the symmetric alpha divergence.

Details

A valid divergence is always non-negative.

Value

Returns the dissimilarity between two codebooks as floating point number (larger or equal than zero).

References

Brandmaier, A. M. (2015). pdc: An R Package for Complexity-Based Clustering of Time Series. Journal of Statistical Software, 67(5), 1--23.

Author

Andreas Brandmaier brandmaier@mpib-berlin.mpg.de

See also

Examples


# create a set of time series consisting
# of sine waves with different degrees of added noise
# and two white noise time series
X <- cbind(
sin(1:500)+rnorm(500,0,.1),
sin(1:500)+rnorm(500,0,.2),
sin(1:500)+rnorm(500,0,.3),
sin(1:500)+rnorm(500,0,.4),
rnorm(500,0,1),
rnorm(500,0,1)
)

# calculate the distance matrix
D <- pdcDist(X,3)

# and plot with lattice package, you will
# be able to spot two clusters: a noise cluster
# and a sine wave cluster
require("lattice")
#> Loading required package: lattice
levelplot(as.matrix(D), col.regions=grey.colors(100,start=0.9, end=0.3))