[Paper Review] gfpop: an R Package for Univariate Graph-Constrained Change-Point Detection
This paper introduces gfpop, an R/C++ package for univariate graph-constrained change-point detection that generalizes functional pruning optimal partitioning to handle arbitrary constraint graphs and multiple loss functions (Gaussian, Poisson, binomial, biweight, Huber). It enables accurate detection of abrupt changes in large datasets by incorporating domain-specific prior knowledge through a user-defined graph, significantly improving performance on challenging data with outliers or complex change patterns, such as isotonic or peak-like signals.
In a world with data that change rapidly and abruptly, it is important to detect those changes accurately. In this paper we describe an R package implementing a generalized version of an algorithm recently proposed by Hocking et al. [2020] for penalized maximum likelihood inference of constrained multiple change-point models. This algorithm can be used to pinpoint the precise locations of abrupt changes in large data sequences. There are many application domains for such models, such as medicine, neuroscience or genomics. Often, practitioners have prior knowledge about the changes they are looking for. For example in genomic data, biologists sometimes expect peaks: up changes followed by down changes. Taking advantage of such prior information can substantially improve the accuracy with which we can detect and estimate changes. Hocking et al. [2020] described a graph framework to encode many examples of such prior information and a generic algorithm to infer the optimal model parameters, but implemented the algorithm for just a single scenario. We present the gfpop package that implements the algorithm in a generic manner in R/C++. gfpop works for a user-defined graph that can encode prior assumptions about the types of change that are possible and implements several loss functions (Gauss, Poisson, binomial, biweight and Huber). We then illustrate the use of gfpop on isotonic simulations and several applications in biology. For a number of graphs the algorithm runs in a matter of seconds or minutes for 10^5 data points.
Motivation & Objective
- To develop a flexible, generic R package that supports constrained multiple change-point detection using prior domain knowledge.
- To extend functional pruning optimal partitioning (FPOP) to handle arbitrary constraint graphs and multiple loss functions beyond Gaussian noise.
- To improve detection accuracy in real-world data—especially with outliers or complex change patterns—by encoding structural assumptions via graph constraints.
- To provide a scalable, efficient implementation for large-scale data (up to 10^5 points) while maintaining computational performance.
- To enable researchers to model diverse change-point scenarios (e.g., peaks, trends, step changes) using a unified framework with customizable penalties and loss functions.
Proposed method
- The package implements a generalized version of the functional pruning algorithm (FPOP) for penalized maximum likelihood estimation under user-defined graph constraints.
- The graph structure encodes allowed transitions between segment means (e.g., up-down for peaks, monotonic increases), enabling constrained inference over possible change patterns.
- The algorithm supports multiple loss functions: Gaussian, Poisson, binomial, biweight, and Huber, allowing robustness to heavy-tailed or corrupted data.
- Dynamic programming is used to efficiently compute the optimal segmentation by minimizing a penalized cost function: $ Q_n(μ) = \sum_{t=1}^n \ell(y_t, \mu_t) + \beta \sum_{t=1}^{n-1} I_{\mu_t \neq \mu_{t+1}} $, where $\ell$ is the chosen loss.
- The implementation uses R/C++ integration for performance, with a focus on scalability and support for large datasets (up to $10^5$ points).
- The framework is formally linked to constrained hidden Markov models (HMMs), allowing interpretation of segment types as states with transition rules.
Experimental results
Research questions
- RQ1Can a generic, extensible R package be built to support graph-constrained change-point detection across diverse loss functions and constraint structures?
- RQ2How does incorporating prior knowledge about change patterns (e.g., peaks, monotonic trends) improve detection accuracy compared to unconstrained models?
- RQ3What is the computational performance of the generalized FPOP algorithm on large datasets with complex constraints and robust losses?
- RQ4How does the package perform on data with heavy-tailed or corrupted noise, especially when using robust loss functions like biweight or Huber?
- RQ5Can the framework be extended to support time-dependent constraints or auto-correlated noise in future work?
Key findings
- The gfpop package successfully implements a generalized functional pruning algorithm that supports arbitrary constraint graphs and five loss functions, enabling flexible modeling of diverse change-point patterns.
- For isotonic and step-wise signals with 30% corrupted data, gfpop with biweight loss achieved the lowest MSE and correctly recovered the true number of changes, outperforming standard methods.
- On $10^5$ data points, the algorithm runs in seconds to minutes, demonstrating scalability for large-scale applications in genomics, neuroscience, and medicine.
- The package is slower than fpop (0.35s vs. 0.031s for $10^5$ points with no change) due to generality, but this trade-off enables modeling of complex, real-world scenarios.
- Monte Carlo simulations confirmed that gfpop with robust losses and positive penalties significantly outperforms other methods in recovering true change points under data corruption.
- The framework is extensible and supports future enhancements such as time-dependent constraints, local parameter fluctuations, and auto-correlated noise models.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.