In these lines of _compute_diagonal:
https://github.com/TDAmeritrade/stumpy/blob/1d98e48d45eee7988a8df946b0c1c40857470ee7/stumpy/stump.py#L157-L161
These terms:
a = ((T_A[i + k + m - 1] - M_T_m_1[i + k])
b = (T_B[i + m - 1] - μ_Q_m_1[i])
c = (T_A[i + k - 1] - M_T_m_1[i + k])
d = (T_B[i - 1] - μ_Q_m_1[i]))
can technically be pre-computed. We just need to figure out how to align them properly with any i, k, pair and pre-compute them in stumpy._stump and pass in a, b, c, d as pre-computed vectors for re-use. This should speed up the performance of larger inputs.
In these lines of
_compute_diagonal:https://github.com/TDAmeritrade/stumpy/blob/1d98e48d45eee7988a8df946b0c1c40857470ee7/stumpy/stump.py#L157-L161
These terms:
can technically be pre-computed. We just need to figure out how to align them properly with any
i,k, pair and pre-compute them instumpy._stumpand pass ina, b, c, das pre-computed vectors for re-use. This should speed up the performance of larger inputs.