View source: R/Distance_matrix_knn_algorithm.R
distance_matrix_PDC | R Documentation |
Pairwise distance matrix of a multivariate time series based on the partial directed coherence among two series. The distance considers both directions of causality and transform it to give 0 in absence of causality between the series.
distance_matrix_PDC(unit, ar, period)
unit |
A matrix representing a multivariate time series where each column is a univariate time series. |
ar |
Integer vector containing all the lags considered for the vector autoregressive model |
period |
Integer referencing the index of the frequency to use for the distance. It gives the Hertz or periods per unit of time; i.e., if the sampling is per minute, and each hour cycle is the period of interest |
a matrix with pairwise distances
Guillermo Granados, and Idris Eckley. "Electricity Demand of Buildings Benchmarked via Regression Trees on Nearest Neighbors Anomaly Scores"
X=matrix( rnorm(2000), ncol=10 )
ar=c(1, 2)
period=10
distance_matrix_PDC( unit=X, ar, period )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.