Skip to content

Repository files navigation

DTMC Self-Loop Absorption Invariance

DOI

Companion Python/NumPy code for absorption-probability invariance under transient self-loop deformation in finite absorbing DTMCs.

Mathematical Summary

For a finite absorbing discrete-time Markov chain in canonical form, let Q be the transient-to-transient block and R the transient-to-absorbing block. The absorption-probability matrix is

B = (I - Q)^(-1) R.

This repository verifies that B is invariant under statewise deformation of transient self-loops: transient self-loop probabilities are scaled by state-specific parameters, and the remaining exit probabilities are renormalized. The code also computes the fundamental matrix, mean and variance of steps to absorption, condition numbers, and the corridor example used in the manuscript.

Installation

python -m venv .venv
.venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

Usage

Run the corridor example and print a table:

python examples/corridor_example.py

Optionally write CSV output:

python examples/corridor_example.py --csv outputs/t_values.csv

Tests

python -m pytest

Repository Contents

  • src/absorption_invariance/: package source code.
  • examples/corridor_example.py: reproducible corridor computations.
  • tests/test_core.py: numerical tests for validation, deformation, invariance, and moments.
  • pyproject.toml: package metadata and dependencies.

Citation

Please cite the archived v1.0.0 release using DOI 10.5281/zenodo.20559528 and the metadata in CITATION.cff.

License

MIT License.

Disclaimer

This is research companion code, provided as-is. It is not intended to be a general-purpose Markov-chain package.

About

Companion Python/NumPy code for absorption-probability invariance under transient self-loop deformation in finite absorbing DTMCs.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

Contributors

Languages