Cumulative Sum of Distances Between Consecutive Cases in a Time Series
Cumulative Sum of Distances Between Consecutive Cases in a Time Series
Demonstration function to compute the sum of distances between consecutive cases in a time series.
psi_auto_distance(x =NULL, distance ="euclidean")
Arguments
x: (required, zoo object or matrix) univariate or multivariate time series with no NAs. Default: NULL
distance: (optional, character vector) name or abbreviation of the distance method. Valid values are in the columns "names" and "abbreviation" of the dataset distances . Default: "euclidean".
Returns
numeric value
Examples
#distance metricd <-"euclidean"#simulate zoo time seriesx <- zoo_simulate( name ="x", rows =100, seasons =2, seed =1)#sum distance between consecutive samplespsi_auto_distance( x = x, distance = d
)
See Also
Other psi_demo: psi_auto_sum(), psi_cost_matrix(), psi_cost_path(), psi_cost_path_sum(), psi_distance_lock_step(), psi_distance_matrix(), psi_equation()