image thumbnail


version 1.0.0 (3.16 KB) by Sachit Butail
opttspart optimally partitions time series data into successive blocks that maximize a fitness function


Updated 16 Jan 2019

View License

opttspart will optimally partition multivariate time series data into successive partitions according to a fitness function [1]. This function for example can be used to detect changes in time series by separating the parts before and after a change that maximize a additive function of the time series. For example, a square wave that has positive and negative parts, can be partitioned by a fitness function that chooses the maximum value between the sum of elements or negative sum of elements; if the partition has only negative elements then a negative sum is more and if it has a mix of negative and positive elements then it is better to move the partition it until you get a larger maximum value. Using cells to first section the time series speeds up the function [2].

[1] Jackson, B., Scargle, J. D., Barnes, D., Arabhi, S., Alt, A., Gioumousis, P., ... & Tsai, T. T. (2005). An algorithm for optimal partitioning of data on an interval. IEEE Signal Processing Letters, 12(2), 105-108

[2] Butail, S. and Porfiri, M. Detecting switching leadership in collective motion, Chaos, 29, 011102, 2019.

Cite As

Sachit Butail (2021). opttspart (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!