Minimum Variance Matching algorithm Step patterns to compute the Minimum Variance Matching (MVM) correspondence between time series **Details** The Minimum Variance Matching algorithm (1) finds the non-contiguous parts of reference which best match the query, allowing for arbitrarily long “stretc
(elasticity=20)
| 24 | import numpy |
| 25 | |
| 26 | def mvmStepPattern(elasticity=20): |
| 27 | # IMPORT_RDOCSTRING mvmStepPattern |
| 28 | """Minimum Variance Matching algorithm |
| 29 | |
| 30 | Step patterns to compute the Minimum Variance Matching (MVM) |
| 31 | correspondence between time series |
| 32 | |
| 33 | **Details** |
| 34 | |
| 35 | The Minimum Variance Matching algorithm (1) finds the non-contiguous |
| 36 | parts of reference which best match the query, allowing for arbitrarily |
| 37 | long “stretches” of reference to be excluded from the match. All |
| 38 | elements of the query have to be matched. First and last elements of the |
| 39 | query are anchored at the boundaries of the reference. |
| 40 | |
| 41 | The ``mvmStepPattern`` function creates a ``stepPattern`` object which |
| 42 | implements this behavior, to be used with the usual [dtw()] call (see |
| 43 | example). MVM is computed as a special case of DTW, with a very large, |
| 44 | asymmetric-like step pattern. |
| 45 | |
| 46 | The ``elasticity`` argument limits the maximum run length of reference |
| 47 | which can be skipped at once. If no limit is desired, set ``elasticity`` |
| 48 | to an integer at least as large as the reference (computation time grows |
| 49 | linearly). |
| 50 | |
| 51 | Parameters |
| 52 | ---------- |
| 53 | elasticity : |
| 54 | integer: maximum consecutive reference elements skippable |
| 55 | |
| 56 | Returns |
| 57 | ------- |
| 58 | |
| 59 | A step pattern object. |
| 60 | |
| 61 | References |
| 62 | ---------- |
| 63 | |
| 64 | Latecki, L. J.; Megalooikonomou, V.; Wang, Q. & Yu, D. *An elastic |
| 65 | partial shape matching technique* Pattern Recognition, 2007, 40, |
| 66 | 3069-3080. |
| 67 | `doi:10.1016/j_patcog.2007.03.004 <https://doi.org/10.1016/j_patcog.2007.03.004>`__ |
| 68 | |
| 69 | Examples |
| 70 | -------- |
| 71 | |
| 72 | >>> import numpy as np |
| 73 | >>> from dtw import * |
| 74 | |
| 75 | The hand-checkable example given in Fig. 5, ref. [1] above |
| 76 | |
| 77 | >>> diffmx = np.array( |
| 78 | ... [[ 0, 1, 8, 2, 2, 4, 8 ], |
| 79 | ... [ 1, 0, 7, 1, 1, 3, 7 ], |
| 80 | ... [ -7, -6, 1, -5, -5, -3, 1 ], |
| 81 | ... [ -5, -4, 3, -3, -3, -1, 3 ], |
| 82 | ... [ -7, -6, 1, -5, -5, -3, 1 ]], dtype=np.double ) |
| 83 |
nothing calls this directly
no test coverage detected