tsdist_ccf: Cross-correlation distance

View source: R/ts_dist.R

tsdist_ccfR Documentation

Cross-correlation distance

Description

Minimum correlation distance considering a +- max lag (lag_max)

Usage

tsdist_ccf(
  ts1,
  ts2,
  type = c("correlation", "covariance"),
  cor_type = "abs",
  directed = FALSE,
  lag_max = 10,
  return_lag = FALSE
)

Arguments

ts1

Array. Time series 1

ts2

Array. Time series 2

type

String. "correlation" or "covariance" to be used (type) in the ccf function.

cor_type

String. "abs" (default), "+", or "-". "abs" considers the correlation absolute value. "+" only positive correlations and "-" only negative correlations.

directed

Boolean. If FALSE (default), the lag interval [-lag_max,+lag_max] is considered. Otherwise, [-lag_max,0] is considered.

lag_max

Integer. Default = 10.

return_lag

Also returns the time lag that leads to the shortest distances.

Value

Distance


ts2net documentation built on June 9, 2022, 9:06 a.m.