ts_dist: Calculate distances between pairs of time series in a list.

View source: R/ts_dist.R

ts_distR Documentation

Calculate distances between pairs of time series in a list.

Description

This function calculates the distance between all combinations of time series in the list and returns a distance matrix. This function is usually the first try and might work if the number of time series and their length are not too big.

Usage

ts_dist(
  ts_list,
  dist_func = tsdist_cor,
  is_symetric = TRUE,
  error_value = NaN,
  warn_error = TRUE,
  num_cores = 1,
  ...
)

Arguments

ts_list

List of time series (arrays).

dist_func

Function to be applied to all combinations of time series. This function should have at least two parameters for each time series. Ex: function(ts1, ts2) cor(ts1, ts2)

is_symetric

Boolean. If the distance function is symmetric.

error_value

The value returned if an error occur when calculating a the distance for a pair of time series.

warn_error

Boolean. If TRUE (default), a warning will rise when an error occur during the calculations.

num_cores

Numeric. Number of cores

...

Additional parameters for measureFunc

Value

A distance or similarity matrix M whose position M_ij corresponds to distance or similarity value between time series i and j.


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