cdtw.dtw.dtw_mat

cdtw.dtw.dtw_mat(x, y)[source]

Computes the full cost (distance) matrix D between all elements of x and y according to

\boldsymbol{D}_{ij} = d(x_i, y_j) +
\min{\lbrace \boldsymbol{D}_{i-1,j-1}, \boldsymbol{D}_{i-1, j},
             \boldsymbol{D}_{i, j-1} \rbrace}

where d(x_i, y_j) = (x_i - u_j)^2 is the Euclidean metric. A squared root of the output matrix D is returned.

Parameters:
x, ynp.ndarray

Input time series, 1-d arrays of arbitrary length.

Returns:
cost_matnp.ndarray

A squared root of the distance matrix D.