pytorch_hamiliton_unittest

Community

Catch regime-model bugs with strict Pytest

Authorulf1
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It prevents subtle mathematical and tensor-shape regressions in vectorized PyTorch Markov Regime-Switching models by enforcing domain constraints and probabilistic invariants during automated unit testing.

Core Features & Use Cases

  • Reparameterization validation: Ensures raw parameters map into safe domains, including strictly positive standard deviations and properly normalized, non-negative transition probabilities.
  • Hamilton filter invariants: Verifies that filtered state assignment probabilities are well-formed at every time step (non-negative and summing to 1.0).
  • Regime identifiability checks: Confirms permutation equivariance when sorting regime states, including consistent reordering across means, sigma parameters, and multi-dimensional transition tensors.
  • Input validation: Asserts expected tensor dimensions and raises errors for mismatched inputs, protecting downstream training and inference.

Quick Start

Use the pytorch_hamiliton_unittest skill to run the unit tests in examples/test_mrs_model.py and verify constraint, sorting, forward-pass, and prediction-step behaviors for your Markov Regime-Switching implementation.

Dependency Matrix

Required Modules

None required

Components

assets

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: pytorch_hamiliton_unittest
Download link: https://github.com/ulf1/trading-regime/archive/main.zip#pytorch-hamiliton-unittest

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.