DEV Community

Cover image for "Future-predictive Jump-driven Network Interaction Clustering Multivariate Bayesian"
miosync-masa
miosync-masa

Posted on

"Future-predictive Jump-driven Network Interaction Clustering Multivariate Bayesian"

Dual Bayesian Regression

My code grew up overnight into a "Future-predictive Jump-driven Network Interaction Clustering Multivariate Bayesian" monster. Wait… Wasn’t this supposed to be just 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.

Image description

🆕 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.

Image description

Play Now!!
colab

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!

Let me know if you want even more practical code examples, or a “how to add a new series” snippet too!

🎁 Open Science & MIT License

“Feel free to fork, use, hack, and remix!
If you make something awesome, let me know!” — Masamichi

Top comments (0)