Minimum correlation distance considering a +- max lag (lag_max)
tsdist_ccf(
ts1,
ts2,
type = c("correlation", "covariance"),
cor_type = "abs",
directed = FALSE,
lag_max = 10,
return_lag = FALSE
)Array. Time series 1
Array. Time series 2
String. "correlation" or "covariance" to be used (type) in the ccf function.
String. "abs" (default), "+", or "-". "abs" considers the correlation absolute value. "+" only positive correlations and "-" only negative correlations.
Boolean. If FALSE (default), the lag interval [-lag_max,+lag_max] is considered. Otherwise, [-lag_max,0] is considered.
Integer. Default = 10.
Also returns the time lag that leads to the shortest distances.
Distance