Learn R Programming

tsmp (version 0.3.1)

mass: Calculates the distance profile using MASS algorithm

Description

Mueen's Algorithm for Similarity Search is The Fastest Similarity Search Algorithm for Time Series Subsequences under Euclidean Distance and Correlation Coefficient.

Usage

mass(data_fft, query_window, data_size, window_size, data_mean, data_sd,
  query_mean, query_sd)

Arguments

data_fft

precomputed data product.

query_window

a vector of numeric. Query window.

data_size

an int. The length of the reference data.

window_size

an int. Sliding window size.

data_mean

precomputed data moving average.

data_sd

precomputed data moving standard deviation.

query_mean

precomputed query average.

query_sd

precomputed query standard deviation.

Value

Returns the distance_profile for the given query and the last_product for STOMP algorithm.

References

  • Abdullah Mueen, Yan Zhu, Michael Yeh, Kaveh Kamgar, Krishnamurthy Viswanathan, Chetan Kumar Gupta and Eamonn Keogh (2015), The Fastest Similarity Search Algorithm for Time Series Subsequences under Euclidean Distance

Website: https://www.cs.unm.edu/~mueen/FastestSimilaritySearch.html

See Also

mass_pre() to precomputation of input values.

Examples

Run this code
# NOT RUN {
w <- mp_toy_data$sub_len
ref_data <- mp_toy_data$data[, 1]
query_data <- mp_toy_data$data[, 1]
d_size <- length(ref_data)
q_size <- length(query_data)

pre <- mass_pre(ref_data, d_size, query_data, q_size, w)

dp <- list()
for(i in 1:(d_size - w + 1)) {
  dp[[i]] <- mass(pre$data_fft, query_data[i:(i - 1 + w)], d_size, w, pre$data_mean, pre$data_sd,
          pre$query_mean[i], pre$query_sd[i])
}
# }

Run the code above in your browser using DataLab