Skip to content

Refactor _compute_diagonal in stumpy.stump #247

@seanlaw

Description

@seanlaw

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions