Skip to content

Releases: AlgorithmicMind/regimelab

v0.4.0 - Next-Open Execution Ledger & Data-Quality Fixes

Choose a tag to compare

@AlgorithmicMind AlgorithmicMind released this 20 Oct 19:13

Highlights

  • New opt-in simulate_next_open and NextOpenResult: an explicit position ledger with opening fills, actual unit drift, publication ordering and observation masks.
  • Self-financing costs on risky buys and sells, cash accounting, and a benchmark using the same ledger conventions.
  • Optional initial-equity baselines for drawdown and Calmar, including inception losses in the new ledger without changing legacy metric defaults.

Fixes And Compatibility

  • HMM convergence metadata now describes the selected highest-likelihood restart. Model selection and fitted parameters are unchanged.
  • The legacy overlay rejects missing, nonfinite or nonpositive prices needed for an exposed return or benchmark. Valid-input golden outputs are preserved.
  • Warning migration: replace non_session_asof with asof_not_in_panel. Absence from a supplied panel does not prove market closure; is_stale=False does not by itself establish exchange-calendar freshness.
  • The legacy close-only API and pipeline defaults remain unchanged. Next-open execution is opt-in and requires caller-supplied, consistently adjusted prices and an exchange schedule.

See the execution contract and changelog for assumptions and migration details.

Validation

  • 184 offline tests passed against an installed package, with tests run outside the checkout.
  • Final release preparation changes documentation only; no functional code changes follow that validation.
  • Ruff, formatting and strict MyPy checks pass.
  • Wheel and source-distribution installation, dependency checks, module imports and both CLI entry points are verified on Windows / Python 3.12.4, without the optional Textual extra.

Distribution

This release includes the wheel, source distribution and SHA256 checksums. GitHub and PyPI publication are separate; PyPI upload is handled by the maintainer.

To install a downloaded wheel:

python -m pip install ./regimelab-0.4.0-py3-none-any.whl

v0.3.0 - State Statistics, simulate_weights & Single Data Path

Choose a tag to compare

@AlgorithmicMind AlgorithmicMind released this 15 Oct 20:09

Highlights v0.3.0

  • Typed regime statistics: LabelAssignment.to_statistics() returns one RegimeStatistics per regime (training-window moments). States that share a regime — the positive-drift guardrail under VOLATILITY/SHARPE — are combined with occupancy-weighted moments, mirroring how relabel_probabilities sums their posteriors; raw_states lists every member state, and return/volatility/Sharpe are None for a regime without weight. TelemetryPayload.state_statistics carries them, statistics_for(regime) looks one up, and WalkForwardFold.statistics holds each fold model's statistics.
  • describe() keeps one row per raw state (as in 0.2.0), sorted by ladder position.
  • Correct signing model: latest_telemetry uses the model and statistics of the fold that produced observation_date, instead of always the last fold.
  • simulate_weights: backtest any hand-supplied target-weight schedule under the same signal-lag, rebalancing and cost assumptions. run_backtest is reimplemented on it with numerically identical output (golden regression test).
  • Breaking (type consumers): BacktestResult.regimes and regime_metrics are optional (None when a weight path rather than a regime signal was simulated).
  • Fix: leading sessions whose confidence is below the floor now hold 100% CASH and earn the risk-free rate, instead of holding zero weights and earning nothing.
  • Breaking — single data path: the pipeline fetches through load_aligned_panel. The panel cache moves from artifacts_dir/cache to data.cache_dir, panels are reused within data.cache_ttl_hours (the TTL is no longer forced to 0) and alignment anchors on data.calendar_anchor; force_refresh=True restores always-refetch.
  • RankingMethod.SHARPE docstring now states it is no longer any classifier's default (hmm/hamilton → STRESS, gmm → VOLATILITY).

Full details in the CHANGELOG.

v0.2.0 - Causal Walk-Forward, Stress Labelling & Official VIX Sourcing

Choose a tag to compare

@AlgorithmicMind AlgorithmicMind released this 07 Oct 19:54

Highlights v0.2.0

  • Causal walk-forward fix: each fold now labels only the interval strictly after its own training window, (r_k, r_{k+1}], filtering the full history from the stationary distribution with frozen parameters — the previous model's posterior is no longer carried forward.
  • Stress labelling (breaking): HMM and Hamilton models rank states by signed stress features via RankingMethod.STRESS; the positive-drift guardrail no longer applies under STRESS. Signs are configurable with ModelSettings.stress_signs.
  • Official volatility sourcing: ^VIX and ^VIX3M are read from CBOE first, then FRED, with the configured provider as fallback (volatility_source="official").
  • Data-quality telemetry: TelemetryPayload gains session_date, observation_date, is_stale and populated warnings (non-session as-of dates reported separately from stale data).
  • Signal vs. investable universes: DataSettings.correlation_assets decouples the correlation features from risk_assets, which now only drives allocation and the backtest.
  • Live signal = backtest signal (breaking): run_single_asof defaults to refit_policy="walkforward", reproducing the walk-forward posterior exactly (train_end = last refit strictly before the observation date); refit_policy="daily" keeps the previous behaviour.

Full details in the CHANGELOG.

v0.1.5 - Model Persistence & Economic Labeling Guardrails

Choose a tag to compare

@AlgorithmicMind AlgorithmicMind released this 04 Sep 23:48

Highlights v0.1.5

  • Economic Guardrails: Positive-drift states can no longer be assigned to HIGH_VOL_BEAR or RISK_OFF.
  • Model Persistence: Added \FittedRegime.save()\ and \FittedRegime.load()\ using np.savez_compressed + JSON.
  • Causal Daily Inference:
    un_single_asof\ now accepts \ itted\ models to run causal Hamilton filtering without retraining.

v0.1.4 - Settings extra='ignore' and foreign env fix

Choose a tag to compare

@AlgorithmicMind AlgorithmicMind released this 04 Sep 19:19

Changes in 0.1.4

  • Switched Settings.model_config from extra="forbid" to extra="ignore" to prevent foreign environment variables (e.g., GOOGLE_API_KEY, DATABASE_URL) from raising validation errors in host applications.
  • Retained strict REGIMELAB_ prefix parsing and immutability (frozen=True).
  • Added regression test for environment pollution.

v0.1.3

Choose a tag to compare

@AlgorithmicMind AlgorithmicMind released this 01 Sep 20:58

🚀 Improvements in v0.1.3

  • Interactive CLI Telemetry: Added granular Rich progress bar and time-remaining estimation across walk-forward folds.
  • Pipeline Callbacks: Exposed progress_callback and status_callback hooks in run_pipeline and run_walk_forward for external integration.
  • Performance Profiling: Streamlined fold boundary dispatching during expanding-window simulations.

v0.1.0 — Institutional Point-in-Time Regime Engine

Choose a tag to compare

@AlgorithmicMind AlgorithmicMind released this 01 Sep 17:59

🚀 What's New in v0.1.0

Initial institutional-grade release of RegimeLab: a deterministic market regime detection engine, systemic risk telemetry pipeline, and walk-forward adaptive asset allocation framework.

Key Features & Architecture

  • Strict Point-in-Time Alignment: Native asof temporal cursors and lagging logic ensuring zero look-ahead bias across all multi-asset inputs.
  • Three Core Classifiers:
    • Hamilton Markov-Switching Regression (statsmodels).
    • Multivariate Gaussian Hidden Markov Models (hmmlearn).
    • Gaussian Mixture Models (scikit-learn) with ridge covariance floor.
  • Canonical State Ordering: Deterministic state labeling to mathematically prevent label switching across rolling folds.
  • Systemic Risk Telemetry: Kritzman Absorption Ratio (PCA), VIX Term Structure (Contango/Backwardation), and Breadth momentum over Sector SPDR baskets.
  • Walk-Forward Engine: Expanding-window backtesting with out-of-sample parameter freezing and realistic transaction cost modeling.
  • Dual Presentation Layer: Static Rich CLI dashboards, interactive Plotly HTML reports, and Textual TUI.
  • Formal Verification: Causality property-based tests via hypothesis and strict static typing with mypy.