masamichi

bayesian-event-detector - Event detection with a memory: Bayesian, history

by
Lambda³ is a history-aware Bayesian event detector for time series. Dual EYE Mode finds both global regime shifts and local anomalies at once. Fully interpretable—explains not just when, but why events happen, with credible intervals. MIT-licensed,open source.

Add a comment

Replies

Best
masamichi
Maker
📌
Hi Product Hunt! 👋 I’m excited to share Lambda³, a history-aware Bayesian event detector for time series. Dual EYE Mode lets you see both global regime shifts and local anomalies—all fully explainable, not just “black-box” results. I built Lambda³ to make time series event detection transparent, collaborative, and easy to extend for any domain. If you have feedback, ideas, or want to contribute (or critique!), I’d love to hear from you. What kinds of data or use cases would you apply it to? Thanks for checking out the project! 🚀
masamichi

Causality Probability (Positive Jump → Negative Jump): 0.40

Predicted Next Event: stable

Time-Dependent Causality (lag steps → P):

{1: 0.4, 2: 0.0, 3: 0.2, 4: 0.0, 5: 0.0, 6: 0.0, 7: 0.0, 8: 0.2, 9: 0.0, 10: 0.0}

Hi Product Hunt! 👋

New ReleaseWhat’s New?

1. Causality Chain Detection

Now automatically analyzes the causal probability that a positive jump (ΔΛC+) is followed by a negative jump (ΔΛC−).

Also supports time-lagged causality analysis, visualizing how causal links evolve over different time windows.

2. Event Forecasting Functionality

Added predict_next_event():

The model can now forecast whether the next structural transition will be a positive jump, negative jump, or stable (no significant change).

Forecast logic is based on the recent sequence of ΔΛC events, with easy hooks for further extension.

3. Interactive Visualization

Bar plots now show time-dependent causality (lag vs. probability).

Jump events and predictions are clearly displayed for easier interpretation.

4. Modular, Extensible Design

Event memory and prediction logic are structured for rapid customization—ready for ML, Markov, or Bayesian upgrades.

Performance

Colab A100 (CPU backend): 300 time steps × 4 params, 6000 samples, ~14 seconds

No divergences, rapid convergence

Supports large time-series (T > 1000) with additional tuning

Want blazing speed? Use NumPyro backend on GPU

Note: The demo runs great on both laptops and cloud GPUs. Colab A100 will give you extra headroom for bigger or more complex models.

masamichi

Dual Bayesian Regression

Mutual cross-series interaction:

Now you can simultaneously fit two time-series with full bidirectional (A↔B) Bayesian regression. Each series can be predicted while incorporating the influence of jumps in the other (via interaction terms).

• Full model posterior (with HDI) for both A & B

→ Visualize effect sizes, uncertainties, and cross-causal coefficients.

🆕 Event Synchronization Analysis

Event-level synchronization rate (σₛ):

Automatically compute synchronization profiles across all lags for binary jump events between series.

Dynamic sync detection:

See how synchronization emerges and fades over time in a sliding window.

Sync network & clustering:

Instantly build a directed network of N-series based on synchronization, and cluster series with similar event patterns.

🆕 Causality Profile Visualization

###Unified visualization:

Plot both single-series (A or B) and cross-causality (A→B, B→A) lag profiles in one graph for intuitive comparison.

Try it Yourself! (Go wild and experiment!)

• Change the random seed and tweak the jump patterns/positions as much as you want—just update L3Config or the data generation arguments.

• For example: set seed_offset=1234 or use pattern_a = "periodic_plus_jump", etc.

• Even though the demo is “Dual” (2-series), you can add as many time series as you like by extending event_series_dict and the series_names=['A','B','C',...] lists.

• Sync networks and clustering are already compatible with any number of series!

“Just add more series to the code and everything (sync, causality, clustering) will scale—no limit!

The system is fully vectorized for multi-series analysis.”

🧑‍🔬 How to Explore

• Use the same random seed for different patterns to isolate pure structural synchrony,

• Or use different seeds for each series to explore independence and noise effects.

• Try consecutive jumps, periodic, chaotic, or mixed patterns—Bayesian modeling, synchrony, and causality will all work out of the box.

Let your curiosity guide you—break things, add new series, and see what patterns emerge!