Mueen's Algorithm for Similarity Search is The Fastest Similarity Search Algorithm for Time Series Subsequences under Euclidean Distance and Correlation Coefficient.
mass_v3(
query_window,
data,
window_size,
data_size,
data_mean,
data_sd,
query_mean,
query_sd,
k = NULL,
...
)
a vector
of numeric
. Query window.
a matrix
or a vector
.
an int
. Sliding window size.
an int
. The length of the reference data.
precomputed data moving average.
precomputed data moving standard deviation.
precomputed query average.
precomputed query standard deviation.
an int
or NULL
. Default is NULL
. Defines the size of batch. Prefer to use a power of 2.
just a placeholder to catch unused parameters.
Returns the distance_profile
for the given query and the last_product
for STOMP
algorithm.
This is a piecewise version of MASS that performs better when the size of the pieces are well aligned with the hardware.
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
mass_pre()
to precomputation of input values.
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 <- tsmp:::mass_pre(ref_data, query_data, w)
dp <- list()
for (i in 1:(d_size - w + 1)) {
dp[[i]] <- tsmp:::mass_v3(
query_data[i:(i - 1 + w)], ref_data,
pre$window_size, pre$data_size, pre$data_mean, pre$data_sd,
pre$query_mean[i], pre$query_sd[i]
)
}