UNIVERSAL_LOG (v7.9.2)

Domain-agnostic structural threshold, multi-regime, and multivariate break detection with multi-null falsification for time series.
Interactive Google Colab Notebooks (One-Click)
| Notebook |
What You Can Run in 60 Seconds |
Launch |
notebooks/01_quickstart_univariate.ipynb |
Univariate Step vs Random Walk vs Smooth Ramp + Inline HTML5/SVG Report |
|
notebooks/02_multi_regime_and_multivariate.ipynb |
Multi-Regime (detect_multi_regime) + v7.8.0 Cholesky Multivariate Falsification (scan_multivariate_channels) |
|
notebooks/03_pdac_immune_gradient_audit.ipynb |
4-Cohort PDAC Continuous Immune Gradient vs Discrete Subtype Audit |
|
monoliths/UNIVERSAL_LOG_v7.9.2_universal.ipynb |
Self-Contained Single-File Package Monolith (Zero External Install) |
|
Overview
UNIVERSAL_LOG is a statistical instrument for detecting regime changes, abrupt jumps, slope breaks, multi-regime transitions, and synchronized multivariate breaks without domain priors. It combines vectorized sliding-window effect sizes, multi-channel structural detectors, permutation-based and Marriott–Pope AR(1)/ARIMA/Cholesky-multivariate falsification suites, walk-forward validation, and 29 complexity/topological estimators organized across levels L1–L7.
Core Design Principles (v7)
- P1 — Zero domain priors: No domain names, domain lexicons, or domain-tuned heuristics in code.
- P2 — No hand-tuned weights: Inverse-variance stability weighting (
1 / (1 + CV)), or equal weights.
- P3 — Name-invariant direction & verdict: Direction equals the empirical sign of Cohen's d, and all random null streams seed from canonical IEEE-754 numeric
values_hash_sha256 (so renaming columns or switching CSV/DataFrame leaves detector, cut, effect size, p-value, and Grade bit-for-bit invariant, verified at runtime).
- P4 — No harmonic prior: Uniform Monte Carlo and permutation nulls; harmonic jitter is an optional comparative ablation only.
- P5 — Falsification first: Every threshold faces permutation-corrected scans,
B=100 vectorized white-noise and shuffled-target nulls, physical-axis OLS + smooth quadratic curvature guard ($H_{0,\text{quad}}$), AR(1)/ARIMA/volatility surrogate nulls, split-half checks, multi-window stability, and expanding-window walk-forward persistence.
- P6 — Effect + CI + p: Never a bare score alone.
- P7 — Full reproducibility: Fixed seeds, input/code metadata, SHA-256 hashes, and deterministic outputs.
- P8 — Calibrated diagnostic ($T_{\log}$): $T_{\log}$ is explicitly calibrated against its temporal permutation null and serves strictly as a diagnostic, never as proof.
Installation
Requirements
- Python 3.10+
numpy, pandas, scipy (core)
matplotlib, seaborn (visualization)
pytest, pytest-cov (testing)
ripser (optional, for Vietoris-Rips PersistentHomology; autonomous H0_UnionFind fallback built-in since v7.6.0)
Editable / Local Install
# Install from PyPI (import name: universal_log)
pip install universal-log-ts
# Or editable local install from source
pip install -r requirements.txt
pip install -e ".[dev]"
With optional persistent homology support:
pip install -e ".[dev,full]"
Project Structure
11-27-2026/
├── LIVRE_BLANC.md # Master living whitepaper ("monolithe pour tous", auto-synced)
├── universal_log/ # Voie 3 (canonical): modular Python package (v7.9.2)
│ ├── __init__.py # Public API exports (15 symbols incl. detect_multi_regime & scan_multivariate_channels)
│ ├── __main__.py # Entry point for `python -m universal_log`
│ ├── cli.py # CLI argument parser & --describe-limits
│ ├── config.py # UniversalConfig & mode presets
│ ├── data.py # UniversalDataset loader, canonical values_hash, axis regularity & synthetic demos
│ ├── stats.py # Cohen's d, bootstrap CI, vectorized permutation tests
│ ├── estimators.py # 29 complexity estimators (incl. autonomous H0_UnionFind) + calibrated T_log
│ ├── detection.py # Vectorized scans, 5 structural channels (physical-axis OLS + two_lines_x phi_within + H0_quad), Cholesky MV surrogate
│ ├── falsification.py # Falsification suite (B=100 nulls), AR(1)/ARIMA/vol surrogates, multi-regime, causal walk-forward, grading
│ ├── diagnostics.py # Optional segmented MC + Step 1-4 suite
│ ├── levels.py # L1..L7 universal structural diagnostics (pre-holdout L7 boundaries & motifs)
│ ├── prediction.py # Locked cross-study motif prediction (deduplicated replications, pre-holdout verified)
│ ├── pipeline.py # analyze() orchestration & exports
│ ├── report_html.py # Self-contained offline HTML5/SVG report renderer (incl. multi-regime bands)
│ └── regression.py # Built-in non-regression self-tests (31 checks)
├── tracks/ # The analytical tracks (Voie 1, Voie 1.1, Voie 2, Voie 3 pointer)
│ ├── README.md # Comparative guide & CLI invocation for all tracks
│ ├── voie_1_holographique_v6.5.0/ # Voie 1: holographic 2-layer T_log, 3-anchor triangulation, CSD, L1-L7a/b
│ ├── voie_1_holographique_v6.6.0/ # Voie 1.1: calibrated double-null holographic track (30-60x faster, H0_UnionFind)
│ ├── voie_2_socle_p1_p8_v7.1.5/ # Voie 2: minimalist P1-P8 single-channel baseline + 3-cohort MC
│ └── voie_3_instrument_calibre_v7.8.0/ # Pointer to universal_log/ & monoliths/
├── monoliths/ # Generated single-file Voie 3 monoliths (.py & .ipynb, v7.9.2)
├── notebooks/ # 3 one-click Google Colab notebooks + exploration.ipynb
├── theory/ # Theoretical T_log corpus (original concept + calibrated v7.4/v7.5)
├── docs/ # GitHub Pages showcase, quickstart, testing, real-data, audits, and canonical T_log spec
├── tools/ # Monolith builders, preprint PDF compiler, figures, SHA-256 manifest, whitepaper sync
├── UNIVERSAL_LOG_v7.1.5_universal.py # Backward-compatible CLI/import shim (delegates to v7.9.2)
├── datasets/ # 9 synthetic benchmark CSVs + metadata
├── datasets_real/ # 19 real non-synthetic empirical CSVs (+ occupancy) + metadata
├── datasets_holdout*/ # 12 chronological SHA-256 blind holdout cohorts (R, v731..v792b)
├── tests/ # Unit tests (62), SOTA & multi-regime vs ruptures benchmarks, MC calibrations, holdouts
├── .github/workflows/ci.yml # Automated CI/CD pipeline
├── MANIFEST.sha256 # Complete SHA-256 provenance manifest
├── pyproject.toml # Package configuration
├── pytest.ini # Pytest configuration
├── requirements.txt # Python dependencies
└── LICENSE # MIT License
Usage
Command Line
# Analyze a CSV / Parquet / JSON dataset
python -m universal_log --input datasets/demo_step.csv --mode fast --output results/demo_step
# Or via installed console script (after `pip install -e .`)
universal-log --input datasets/demo_step.csv --mode robust
# Specify explicit control and target columns
python -m universal_log --input data.csv --control time --target signal_1
# Run synthetic built-in demos
python -m universal_log --demo step
python -m universal_log --demo logistic
python -m universal_log --demo null
# Run built-in non-regression test suite
python -m universal_log --self-test
# Print frozen routing gates, stubs, surrogate rules, and non-claims
python -m universal_log --describe-limits
Key CLI Flags
--input: Path to CSV, Parquet, or JSON file.
--control: Ordered control axis column name (auto-inferred if omitted).
--target: Target variable column name (auto-inferred if omitted).
--mode: Sampling preset: fast, robust, or full.
--detection-mode: auto (selects among level_shift, detrended_jump, and slope_break when appropriate) or mean (raw level shift only).
--output: Output directory (default: ./results_v7).
--complexity-diagnostics: Enable exploratory calibrated T_log, full-flux estimators, and L7 sliding-window interactions (disabled by default on the standard analyze() path; required by predict_universal()). A single-pass L5 pre/post-$T_0$ contrast across the 13 unique dimension estimators always runs on the default path as a non-voting descriptor.
--describe-limits: Print frozen DEFAULT_ROUTING_GATES, estimator stubs, surrogate/grading limits, and non-claims.
--full-validation: Enable heavy 3-cohort segmented MC + trajectory validation.
--harmonic-ablation: Run optional harmonic-jitter robustness ablation.
--seed: Random seed (default: 42).
Python API
from universal_log import UniversalConfig, analyze
config = UniversalConfig(
seed=42,
mode="robust",
detection_mode="auto",
output_dir="./results_v7",
verbose=True,
)
result = analyze("datasets/demo_step.csv", config=config)
print(result["grade"]["grade"], result["scan"]["control_value"])
Execution Modes
| Mode |
Bootstrap |
Pairwise Permutations |
Scan Permutations |
MC Paths (--full-validation) |
fast |
100 |
200 |
200 |
100 |
robust |
300 |
500 |
500 |
200 |
full |
1000 |
1000 |
1000 |
400 |
Testing & Visualization
# Unit & integration tests
pytest -v
# Built-in non-regression checks
python -m universal_log --self-test
# Regenerate synthetic benchmark datasets
python tests/generate_test_datasets.py
# Run full synthetic benchmark suite and write reports to results/reports/
python tests/run_tests.py
# Run multi-mode stability comparison (fast vs robust)
python tests/run_multi_mode_tests.py
# Run cross-domain benchmark on 19 real non-synthetic empirical datasets + predict_universal() validation
python tests/run_real_datasets.py --mode fast
# Run frozen gate sensitivity ablation (+-10%, +-20%)
python tests/run_ablation.py --ablation
# Prepare blind SHA-256 holdout manifest (downloads, hashes code + data, NO analysis)
python tests/run_ablation.py --prepare-holdout
# Evaluate blind holdout ONCE (verifies code/data hashes, then runs analyze)
python tests/run_ablation.py --evaluate-holdout
# Render summary plots to results/visualizations/
python tests/visualize_results.py
Outputs
Each analyze() run writes four files into --output:
results.json: Full structured output (universal_contract, scan, level_shift_scan, structural_scans, cascade, levels L1–L7, falsification, walk_forward, grade, estimators_by_flux, t_log_target, invariance_rename_test, manifest).
thresholds.csv: Central threshold $T0$ and 5-point derivative cascade ($T_{-2}, T\{-1}, T0, T_{+1}, T\{+2}$).
report.txt: Concise human-readable summary.
report.html: Self-contained interactive HTML5/SVG visual report (series + $T0$ + cascade $T_{-2}\dots T\{+2}$ + active transformed view + null comparison + L1–L7 & estimators) directly openable offline in any browser.
Disclaimer & Known Methodological Scope (v7.9.2)
STATUS: Threshold detection and falsification instrument.