inner-banner-bg

Journal of Mathematical Techniques and Computational Mathematics(JMTCM)

ISSN: 2834-7706 | DOI: 10.33140/JMTCM

Impact Factor: 1.3

The Clock of Regimes: Matrix-Analytic Solutions for Continuous-Time Survival in Discrete HMMs using the R KRONX Package*

Abstract

Oscar Linares and Ricards Bulavs

Hidden Markov Models (HMMs) are widely used to identify latent regime dynamics in financial time series, yet standard R implementations report state membership probabilities rather than the structural geometry of residence and absorption (ruin). This paper introduces KRONX, an R package that extends discrete-time HMMs into a survival- analytic framework through a matrix-operator chain. Starting from a Student-t HMM transition matrix A, the package constructs a hazard-adjusted sub-stochastic operator Q, a sub-generator K = Q − I, and the fundamental matrix N = −K −1 of cumulative expected sojourn times before absorption—adapting the mean-residence-time machinery from compartmental analysis to financial regime dynamics. The core analytical contribution is an exact, closed-form derivation of residence weights and a finite-horizon ruin bound, avoiding the numerical noise and O (S · T) cost of Monte Carlo simulation. An empirical workflow using E-mini S&P 500 futures demonstrates the full pipeline from model specification through residency geometry and risk quantification. Written in pure R with no external dependencies beyond stats and utils, KRONX is designed for auditability, reproducibility, and integration into existing HMM-based analysis workflows.

PDF