falsesync
Diagnostics for aggregation-induced false synchrony in change-point analysis.
Scientific motivation
Many engineering and observational studies average a panel of unit-level series (turbines, battery cells, sensors, regions) and then fit a change point to the aggregate. A sharp aggregate breakpoint is easily read as evidence that the units changed together. That reading is not justified in general: when unit transitions occur at heterogeneous times (\tau_i \sim F_\tau), the aggregate mean is a smoothed curve (m(t) = a + A,(g * F_\tau)(t)) that can still produce a well-defined, strong breakpoint. The fitted aggregate breakpoint is a functional (T_M(F_\tau, g, w, \text{window}, \text{noise})) that depends on the breakpoint operator (M), the observation window, the weights, the observation process, and the noise, and it need not coincide with the mean, median, or mode of the timing distribution.
What falsesync does
- simulates unit-level transition panels with configurable timing laws, transition shapes, weights, observation windows, trends, and noise;
- computes weighted aggregates and aggregate breakpoints under several operators (least squares, maximum slope, CUSUM, binary segmentation) and reports the spread across operators;
- estimates unit-level breakpoints with bootstrap uncertainty and a floor-corrected timing dispersion (\mathrm{sd}_{\mathrm{corr}} = \sqrt{\max(\mathrm{sd}^2(\hat\tau_i) - \bar s^2, 0)});
- returns calibrated probabilities for five timing regimes
(
SYNCHRONOUS,NEAR_SYNCHRONOUS,DIFFUSE_ASYNCHRONOUS,CLUSTERED,NO_TRANSITION) from a classifier calibrated on a separate simulation grid; - issues a false common-event warning when the aggregate break is strong but the calibrated probability of synchrony is low, plus warnings for trend confounding, operator dependence, and observation-process risks.
What falsesync does not claim
- It is not a causal method and does not identify what caused any transition.
- A low synchrony probability is a warning that the aggregate break should not be read as a common event; it is not a test that rejects synchrony.
- The regime probabilities are calibrated only for data-generating conditions
resembling the calibration grid (see
simulations/configs/).
Known limitations
- Informative observation processes (entry or dropout related to transition timing) can create apparent synchrony; this failure mode is detectable in simulation but not corrected by the package.
- Trend heterogeneity across units can be confounded with timing heterogeneity.
- Unit-level break uncertainty inflates apparent timing dispersion; the floor correction reduces but does not remove this effect.
- The aggregate breakpoint location is operator-dependent; different operators can give materially different locations on the same aggregate.
- Without unit-level data, synchrony cannot be certified from the aggregate alone.
Installation
Python >= 3.10.
git clone https://github.com/bougtoir/falsesync.git
cd falsesync
pip install . # or: pip install -e ".[dev]" for tests
Optional: pip install ".[cp]" adds ruptures-backed detectors. The
reported binary-segmentation results were computed with ruptures 1.1.10, so
FULL replication requires pip install ".[dev,cp]".
Minimal example
python examples/minimal_example.py
The example simulates 80 units with diffuse (normal, SD 1.1) transition times,
fits FalseSynchronyModel with the shipped calibrated classifier, and prints
the aggregate breakpoint, the corrected timing dispersion, the five regime
probabilities, and the warnings. In outline:
import joblib
import numpy as np
from falsesync import simulation
from falsesync.model import FalseSynchronyModel
rng = np.random.default_rng(1)
t = np.linspace(0, 10, 180)
taus = simulation.sample_taus(80, {"kind": "normal", "mu": 5.0, "sigma": 1.1}, rng)
panel = simulation.simulate_panel(t, taus, shape="logistic", amplitude=1.5,
width=0.3, noise_sd=0.2, rng=rng)
clf = joblib.load("simulations/calibration/classifier.joblib")
res = FalseSynchronyModel(classifier=clf).fit(t, panel.values)
print(res.aggregate_breakpoint, res.timing_dispersion["sd_corrected"])
print(res.regime_probabilities, res.interpretation_warning)
Main workflow
simulations/run_grid.pysimulates a configuration grid (simulations/configs/*.yaml) and extracts diagnostic features.simulations/run_calibration.pyfits and temperature-calibrates the regime classifier on the calibration grid (simulations/calibration/classifier.joblib).simulations/run_evaluation.pyevaluates the frozen classifier on the locked evaluation grid.simulations/run_stress.py,run_missingness_mitigation.py, andrun_near_sync.pyrun the robustness and stress conditions.simulations/run_kelmarsh.pyandsimulations/run_nasa_battery.pyrun the two empirical demonstrations.simulations/make_phase3_figures.pybuilds Figures 1-6.
Reproducing the Technometrics results
| Mode | Command | Content | Runtime (1 CPU core) |
|---|---|---|---|
| QUICK | python replication/run_quick.py |
tests, minimal example, smoke grid, re-evaluation of the locked grid with the shipped classifier, regeneration of Figures 1-4, comparison with reference tables and figures | < 1 min |
| FULL | python replication/run_full.py |
data download and checksum verification, calibration, locked evaluation, stress tests, both empirical analyses, all figures, comparison with reference tables; needs the cp extra |
about 15 min |
Both scripts exit non-zero if any regenerated result table differs from the
shipped reference copy. make all / make quick run the same steps.
The reference figures were rendered with matplotlib 3.10. matplotlib 3.11
reproduces every result table exactly but renders Figures 1-4 with small
pixel differences, which the QUICK figure comparison reports as DIFFERS;
use pip install "matplotlib<3.11" for a pixel-level figure match.
Locked evaluation. simulations/configs/evaluation_locked.yaml (seeds
3000-3999) was fixed and committed before the evaluation was run and was not
edited afterwards; its SHA-256 is recorded in simulations/configs/SHA256SUMS.
The calibration grid (calibration.yaml) and the development grid
(development.yaml) use disjoint seed ranges. METHOD_FREEZE.md lists the
frozen thresholds and method choices.
Traceability. manuscript_number_trace.csv maps every number reported in
the manuscript to the result file and column that produces it;
figure_manifest.csv and table_manifest.csv map figures and tables to their
generating scripts and inputs.
Data acquisition
No raw data are redistributed in this repository. python fetch_data.py
downloads the two public datasets from their original repositories, verifies
each file against the SHA-256 recorded in data/acquisition_ledger.csv, and
extracts the files used by the analyses into data/raw/ (git-ignored). See
data/README.md for sources, licenses, and citations.
Repository structure
src/falsesync/ package source
tests/ unit tests (theory identities, workflow)
examples/ minimal example
simulations/ simulation, calibration, evaluation, empirical scripts
configs/ development, calibration, locked evaluation grids
calibration/ calibrated classifier artifact
results/ simulated grid outputs
replication/ QUICK and FULL replication entry points
proofs/ proofs of propositions P1-P8
outputs/ reference figures
data/ acquisition ledger and data documentation
*.csv reference result tables
math_specification.md, diagnostic_specification.md, METHOD_FREEZE.md,
counterexamples.md method documentation
Citation
See CITATION.cff. Please cite the software and the accompanying manuscript:
T. Onishi, "Aggregation-Induced False Synchrony in Change-Point Analysis"
(manuscript submitted to Technometrics).
License
MIT (see LICENSE). Data obtained through fetch_data.py remain under their
original licenses (see data/README.md).
Manuscript status
Version 0.1.2 corresponds to the manuscript as submitted to Technometrics. The manuscript has not been peer reviewed or accepted.
Metadata
Release files for falsesync 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| falsesync-0.1.2.tar.gz | 32.4 kB | Without provenance | Details for falsesync-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| falsesync-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for falsesync-0.1.2-py3-none-any.whl |
Total release size: 64.0 kB
Release files / falsesync-0.1.2.tar.gz
| Download URL | falsesync-0.1.2.tar.gz |
|---|---|
| Size | 32.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5b6392d6f3a2d70f6878101c37dd1304c76de14643dba3e894235a888dff34a
|
|
BLAKE2b-256 checksum How to use checksums |
5d56c928c83b0118e618470e1ba30385c5d2736a470a890338b4de7cef9c0ef9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / falsesync-0.1.2-py3-none-any.whl
| Download URL | falsesync-0.1.2-py3-none-any.whl |
|---|---|
| Size | 31.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aaf422029c01f321327874f65025ba856f15e21e913371a9f0bb7fcdd9ccd8bf
|
|
BLAKE2b-256 checksum How to use checksums |
d446722a30393df298473aaf40fc97f099cc1cbe924994aaf70638bf9dad76af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for falsesync 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.