Compute (Numba JIT-compiled) and update the (top-k) Pearson correlation (ρ), ρL, ρR, I, IL, and IR sequentially along individual diagonals using a single thread and avoiding race conditions. Parameters ---------- T_A : numpy.ndarray The time series or sequence for w
(
T_A,
T_B,
m,
μ_Q,
M_T,
σ_Q_inverse,
Σ_T_inverse,
cov_a,
cov_b,
cov_c,
cov_d,
T_A_subseq_isfinite,
T_B_subseq_isfinite,
T_A_subseq_isconstant,
T_B_subseq_isconstant,
diags,
diags_start_idx,
diags_stop_idx,
thread_idx,
ρ,
ρL,
ρR,
I,
IL,
IR,
ignore_trivial,
)
| 18 | fastmath=config.STUMPY_FASTMATH_FLAGS, |
| 19 | ) |
| 20 | def _compute_diagonal( |
| 21 | T_A, |
| 22 | T_B, |
| 23 | m, |
| 24 | μ_Q, |
| 25 | M_T, |
| 26 | σ_Q_inverse, |
| 27 | Σ_T_inverse, |
| 28 | cov_a, |
| 29 | cov_b, |
| 30 | cov_c, |
| 31 | cov_d, |
| 32 | T_A_subseq_isfinite, |
| 33 | T_B_subseq_isfinite, |
| 34 | T_A_subseq_isconstant, |
| 35 | T_B_subseq_isconstant, |
| 36 | diags, |
| 37 | diags_start_idx, |
| 38 | diags_stop_idx, |
| 39 | thread_idx, |
| 40 | ρ, |
| 41 | ρL, |
| 42 | ρR, |
| 43 | I, |
| 44 | IL, |
| 45 | IR, |
| 46 | ignore_trivial, |
| 47 | ): |
| 48 | """ |
| 49 | Compute (Numba JIT-compiled) and update the (top-k) Pearson correlation (ρ), |
| 50 | ρL, ρR, I, IL, and IR sequentially along individual diagonals using a single |
| 51 | thread and avoiding race conditions. |
| 52 | |
| 53 | Parameters |
| 54 | ---------- |
| 55 | T_A : numpy.ndarray |
| 56 | The time series or sequence for which to compute the matrix profile |
| 57 | |
| 58 | T_B : numpy.ndarray |
| 59 | The time series or sequence that will be used to annotate `T_A`. For every |
| 60 | subsequence in `T_A`, its nearest neighbor in `T_B` will be recorded. |
| 61 | |
| 62 | m : int |
| 63 | Window size |
| 64 | |
| 65 | μ_Q : numpy.ndarray |
| 66 | Mean of the query sequence, `Q`, relative to the current sliding window |
| 67 | |
| 68 | M_T : numpy.ndarray |
| 69 | Sliding mean of time series, `T` |
| 70 | |
| 71 | σ_Q_inverse : numpy.ndarray |
| 72 | Inverse standard deviation of the query sequence, `Q`, relative to the current |
| 73 | sliding window |
| 74 | |
| 75 | Σ_T_inverse : numpy.ndarray |
| 76 | Inverse sliding standard deviation of time series, `T` |
| 77 |