Optimize DTW complexity and tuning
masterDTW has quadratic time complexity. You can reduce this using several parameters:
Complexity Reduction
window: Implements a Sakoe-Chiba band, limiting shifts allowed away from the diagonals.max_dist: Avoids computing paths larger than this value. Returns infinity if no path is found within this limit.use_pruning: WhenTrue, automatically setsmax_distto the Euclidean upper bound.max_step: Limits the maximum step size allowed in a path.max_length_diff: Returns infinity if the difference in sequence lengths exceeds this value.
Cost Tuning
penalty: An additional cost applied during compression or expansion.psi: (Psi-relaxation) Allows up topsinumber of start/end points to be ignored to achieve a lower distance, useful for cyclical sequences.