Skip to content

Sprint 6: add opt-in robust variance-ratio diagnostics and release v0.2.0#33

Open
LautaroParada wants to merge 1 commit intomasterfrom
codex/implement-sprint-6-and-release-0.2.0
Open

Sprint 6: add opt-in robust variance-ratio diagnostics and release v0.2.0#33
LautaroParada wants to merge 1 commit intomasterfrom
codex/implement-sprint-6-and-release-0.2.0

Conversation

@LautaroParada
Copy link
Copy Markdown
Owner

Motivation

  • Add an opt-in robust variance-ratio family (AVR, WBAVR, Chow-Denning-style max test) while preserving the existing v1 weak-form battery behavior and public API.
  • Introduce minimal internal refactor to separate diagnostic helpers from orchestration for easier extensibility and to support efficient bootstrap math on pre-normalized arrays.
  • Provide deterministic, well-tested implementations and documentation for v0.2.0 without adding heavy dependencies or rolling support for the new robust tests.

Description

  • Added RobustVRConfig and extended BatteryConfig with robust_vr, implementing validation rules in __post_init__ and exporting RobustVRConfig from the package root (src/variance_test/models.py, src/variance_test/__init__.py).
  • Refactored internal helpers into a new src/variance_test/diagnostics/ subpackage and moved classic helpers (vr_classic.py, ljung_box.py, runs.py, arch_lm.py) out of battery.py while keeping battery.py as the orchestrator.
  • Implemented robust VR internals and pure math helpers in diagnostics/robust_vr.py, including _compute_vr_value_from_log_prices, _compute_heteroskedastic_z2_from_log_prices, automatic q selection (AVR), wild-bootstrap WBAVR using Rademacher weights, and a Chow-Denning-style max test with Sidak-normal calibration (chow_denning).
  • Integrated robust tests into run_weak_form_battery as opt-in, appending avr, wbavr, and chow_denning in the required order and adding multiple_testing["robust_vr_summary"] only when robust VR is enabled; v1 outputs and rolling payload are unchanged when not enabled (src/variance_test/battery.py).

Testing

  • Ran the full test suite with pytest -q, which completed successfully: 99 passed with a small number of non-critical warnings relating to numerical edge cases.
  • Added comprehensive unit tests for the robust features in tests/test_robust_vr.py covering config validation, pure-math parity with EMH().vrt, deterministic bootstrap behavior, returns/log_prices equivalence, edge cases, and synthetic IID/AR(1) behavior.
  • Verified public API expectations in the updated tests/test_public_api.py and ensured RobustVRConfig is exported and present in __all__.
  • Attempted python -m build in this environment but packaging build could not be executed because the build module is not available and network-restricted installation of that tool failed; this did not affect test success.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant