Conjugate Bayesian Two-step Change Point Detection for Hawkes Process

Zeyue Zhang, Xiaoling Lu, Feng Zhou

In the world of data science, we often deal with "bursty" event sequences—think of a flurry of tweets during a breaking news event, a cluster of high-frequency trades, or a sudden spike in network traffic during a cyberattack. To model these, researchers frequently turn to the Hawkes process, a mathematical framework designed to capture how one event can trigger others.

However, real-world processes aren't static. The "rules" governing these bursts can shift abruptly due to external shocks. Detecting these shifts, or change points, is crucial, but doing so accurately and quickly has historically been a mathematical nightmare. A new paper, "Conjugate Bayesian Two-step Change Point Detection for Hawkes Process," offers a clever way out of this complexity.

TL;DR

The authors introduce CoBay-CPD, a method that uses "data augmentation" to simplify the complex math behind detecting shifts in event sequences. By making the model's equations "conjugate" (mathematically compatible), they enable a lightning-fast algorithm that is significantly more accurate and efficient than previous state-of-the-art Bayesian methods.

What Problem Does This Paper Address?

Hawkes processes are "self-exciting"—an event now increases the probability of an event in the near future. But what happens when the underlying behavior changes? For example, a social media platform might see a permanent shift in user engagement after a UI update.

Detecting these change points usually involves a "two-step" Bayesian approach:

  1. Estimation: Use historical data to guess the current parameters of the process.
  2. Prediction: Predict when the next event should happen. If the actual event is a massive outlier compared to the prediction, you've likely found a change point.

The "gap" is that the math for Hawkes processes is non-conjugate. In Bayesian terms, this means the "prior" (what we think we know) and the "likelihood" (what the data tells us) don't play nice together. This forces researchers to use slow, approximate numerical methods like Markov Chain Monte Carlo (MCMC) or Variational Inference, which lack analytical solutions. In a high-speed environment where you need to detect a change now, these slow methods are a major bottleneck.

Methods

The authors' core innovation is CoBay-CPD (Conjugate Bayesian Change Point Detection). They solve the non-conjugacy problem using a technique called data augmentation.

  • The Secret Sauce: They introduce auxiliary latent variables (specifically Pólya-Gamma variables and marked Poisson processes) into the model. This "augments" the data in a way that makes the likelihood function mathematically compatible with the Gaussian priors.
  • Analytical Gibbs Sampler: Because the model is now "conditionally conjugate," the authors can derive a Gibbs sampler with closed-form, analytical expressions. Instead of the computer struggling through complex integrals, it can simply follow a direct formula to update its beliefs.
  • Nonlinear Flexibility: Unlike many previous models that only account for "excitation" (events causing more events), this model uses a sigmoid link function. This allows it to model inhibition—where an event might actually make the next one less likely.

Datasets

The researchers validated CoBay-CPD across three distinct environments:

  1. Synthetic Data: A controlled environment where change points were manually inserted to test if the model could recover ground-truth parameters.
  2. WannaCry Cyber Attack: Real-world traffic logs from the 2017 ransomware attack. The goal was to detect the sudden shifts in network behavior as the virus spread.
  3. NYC Vehicle Collisions: A dataset of over a million collision records. The model was tasked with identifying shifts in traffic accident patterns (e.g., rush hour transitions).

Key Insights and Ideas

  • Conjugacy is King: The move from non-conjugate to conjugate inference isn't just a mathematical neatness; it’s the difference between a model that works in "research time" and one that works in "real time."
  • Handling the "Cold Start" after a Change: One of the biggest challenges in change point detection is that once a change is detected, you suddenly have very little "post-change" data to estimate new parameters. The Bayesian approach shines here because the "prior" knowledge acts as a stabilizer, preventing the model from overreacting to small amounts of new data.
  • Inhibition Matters: By allowing for negative influence (inhibition), the model is much more robust for real-world datasets like traffic, where an accident in one lane might actually slow down the rate of subsequent arrivals rather than just "exciting" them.

Key Results

The results show that CoBay-CPD is both a speed demon and a precision instrument.

Performance comparison on synthetic data.
  • Accuracy: On synthetic data, CoBay-CPD achieved a False Negative Rate (FNR) of 0.13, significantly lower than the 0.33–0.50 seen in baseline models (SMCPD and SVCPD).
  • Speed: In the NYC Vehicle Collisions test, CoBay-CPD ran in 8.70 minutes, while the most comparable nonlinear baseline (SVCPD+Inhibition) took over 64 minutes.
  • Robustness: Ablation studies showed the model remains stable across various hyperparameter settings, such as the number of basis functions used to model the event influence.

Limitations and Future Work

While powerful, the authors note a few hurdles:

  • Multivariate Complexity: Currently, the model is designed for univariate sequences (one type of event). Extending this to multivariate Hawkes processes (where different types of events influence each other) is challenging because change points might occur in one dimension but not others.
  • Event Locations: The current method focuses on when events happen. In the future, the authors want to incorporate where they happen (spatial data) to create a more holistic detection system.

For those interested in the implementation, the authors have made their code publicly available on GitHub.

Summary updated

BibTeX
@inproceedings{zhang2024conjugate,
  author = {Zeyue Zhang and Xiaoling LU and Feng Zhou},
  title = {{Conjugate Bayesian Two-step Change Point Detection for Hawkes Process}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=WoKtFJf9VG},
}
Figure