Statistical Significance Criteria for Multivariate Time Series Motifs
Project description
MSig
Statistical Significance Testing for Multivariate Time Series Motifs
MSig evaluates whether discovered motifs occur more frequently than expected by chance, using rigorous statistical methods.
Installation
Using uv (recommended)
# Clone the repository
git clone https://github.com/MiguelGarcaoSilva/msig.git
cd msig
# Sync dependencies (includes STUMPY and LAMA)
uv sync
# Optional: Install MOMENTI (for MOMENTI experiments - Linux/Windows only)
uv pip install git+https://github.com/aidaLabDEI/MOMENTI-motifs
Note: MOMENTI has platform-specific dependencies and may not install on macOS.
Using pip
# Clone repository
git clone https://github.com/MiguelGarcaoSilva/msig.git
cd msig
# Install with experiment dependencies (includes STUMPY, LAMA, and MOMENTI)
pip install -e ".[experiments]"
# Or install dependencies manually
pip install -e .
pip install stumpy # For STUMPY experiments
pip install leitmotif # For LAMA experiments
pip install git+https://github.com/aidaLabDEI/MOMENTI-motifs # For MOMENTI experiments
Quick Start
from msig import Motif, NullModel
import numpy as np
# Your multivariate time series (m variables × n time points)
data = np.array([...])
# Create null model
model = NullModel(data, dtypes=[float, float], model="empirical")
# Test motif significance
motif = Motif(pattern, variables, thresholds, n_matches)
probability = motif.set_pattern_probability(model, vars_indep=True)
pvalue = motif.set_significance(max_possible_matches, n_variables)
print(f"p-value: {pvalue:.2e}")
See the examples/ folder for complete examples (simple_example.py and example.ipynb).
Running Experiments
The repository includes case studies on three datasets with three discovery methods (STUMPY, LAMA, MOMENTI):
# Run individual experiments
uv run python experiments/audio/run_stumpy.py
uv run python experiments/audio/run_lama.py
uv run python experiments/audio/run_momenti.py
uv run python experiments/populationdensity/run_stumpy.py
uv run python experiments/populationdensity/run_lama.py
uv run python experiments/populationdensity/run_momenti.py
uv run python experiments/washingmachine/run_stumpy.py
uv run python experiments/washingmachine/run_lama.py
uv run python experiments/washingmachine/run_momenti.py
Results are saved to results/<dataset>/<method>/.
Citation
@article{silva2024msig,
title={On Why and How Statistical Significance Criteria Can Guide Multivariate Time Series Motif Analysis},
author={Silva, Miguel G. and Henriques, Rui and Madeira, Sara C.},
year={2024}
}
License
MIT License - see LICENSE file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file msig-0.1.2.tar.gz.
File metadata
- Download URL: msig-0.1.2.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20645b83a74e952b522b08fd76bae9e4db3e386677a9302d4804a0d4259a7dcb
|
|
| MD5 |
3a5728554e0efa397a4a5967f4458587
|
|
| BLAKE2b-256 |
995e2030861d95a9b9178f9cf0409ae5e540c3e1ae95f7a284d16b221f30b1a9
|
File details
Details for the file msig-0.1.2-py3-none-any.whl.
File metadata
- Download URL: msig-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9fd255469a1c644c150ff338e95054d9bea9e119421cfac2000510aeed7a52f
|
|
| MD5 |
7c86363732a9420c2488000f6a17fc12
|
|
| BLAKE2b-256 |
fc7381d11b0b05d008bb603a1bef0d1071c7c61a499e475f2b484209f0c00354
|