distance_matrix_coherence: Distance matrix from a coherence measure

View source: R/Distance_matrix_knn_algorithm.R

distance_matrix_coherenceR Documentation

Distance matrix from a coherence measure

Description

Pairwise distance matrix of a multivariate time series based on computing the squared coherence and transformed it to represent a distance at a specific frequency

Usage

distance_matrix_coherence(unit, span1, span2, period)

Arguments

unit

A matrix representing a multivariate time series where each column is a univariate time series.

span1

Odd integer giving the widths of modified Daniell smoothers to be used to smooth the periodogram. Refers to the bandwidth of the smoothing process.

span2

Odd integer giving the widths of modified Daniell smoothers to be used to smooth the periodogram. Control another level of smoothing to the spectral density estimation without altering the peaks

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

Value

a matrix with pairwise distances

See Also

For more details, check the astsa package documentation on CRAN or visit the GitHub repository https://github.com/nickpoison/astsa.

Examples

X=matrix( rnorm(2000), ncol=10  )
span1=2
span2=2
period=3
distance_matrix_coherence(unit=X, span1, span2, period )

AnomalyScore documentation built on April 4, 2025, 3:13 a.m.