Binary segmentation is the classic greedy algorithm which recursively splits a sequential data set by optimizing some loss or likelihood function. Binary segmentation is widely used for changepoint detection in data sets measured over space or time, and as a sub-routine for decision tree learning. In theory it should be extremely fast for $N$ data and $K$ splits, $O(N K)$ in the worst case, and $O(N \log K)$ in the best case. In this paper we describe new methods for analyzing the time and space complexity of binary segmentation for a given finite $N$, $K$, and minimum segment length parameter. First, we describe algorithms that can be used to compute the best and worst case number of splits the algorithm must consider. Second, we describe synthetic data that achieve the best and worst case and which can be used to test for correct implementation of the algorithm. Finally, we provide an empirical analysis of real data which suggests that binary segmentation is often close to optimal speed in practice.
翻译:二分分割是一种经典的贪心算法,它通过优化某种损失或似然函数递归地分割序列数据集。二分分割广泛应用于时空测量数据集的变点检测,并作为决策树学习的子程序。理论上,该算法对$N$个数据和$K$次分割应具有极高的效率:最坏情况下时间复杂度为$O(N K)$,最优情况下为$O(N \log K)$。本文提出分析给定有限$N$、$K$及最小段长参数下二分分割时间与空间复杂度的新方法。首先,我们描述可用于计算算法必须考虑的分割次数最优值与最差值的算法。其次,我们构建达到最优与最差情况的合成数据,这些数据可用于测试算法的正确实现。最后,我们通过对实际数据的实证分析表明,二分分割在实践中的运行速度通常接近最优。