Time-Inhomogeneous Hidden Markov Models
- Time-Inhomogeneous Hidden Markov Models (TIHMMs) are extensions of HMMs that use time-, position-, or covariate-indexed transition matrices instead of a constant one.
- They capture periodic, positional, and irregular interval variations, providing more precise modeling in applications such as genomics, behavioral studies, and continuous-time analysis.
- Sophisticated training and inference methods, including DP-SGD, numerical ODE solvers, and adaptive algorithms, enable robust performance even under complex nonstationary conditions.
Searching arXiv for recent and foundational work on time-inhomogeneous hidden Markov models and closely related nonhomogeneous HMM/HSMM formulations. Search query: "time-inhomogeneous hidden Markov models nonhomogeneous hidden Markov models hidden semi-Markov periodic arXiv" Time-inhomogeneous hidden Markov models (TIHMMs) are hidden Markov models in which the latent transition mechanism is not constant across the index set of the sequence. In the discrete-time formulation, this means replacing a single transition matrix by a time-, phase-, position-, interval-, or covariate-indexed family of matrices, while retaining the usual latent-state representation and conditional independence structure of the observation model. Across the recent literature, TIHMMs appear in position-dependent models for SNP sequences, periodically varying models for behavioral time series, discrete-time representations induced by continuous-time Markov dynamics, and non-homogeneous HMMs in which covariates drive both transitions and emissions (Rahimian et al., 7 Oct 2025, Koslik et al., 2023, Liu et al., 2021, Hubin, 2019).
1. Formal definition and canonical notation
A standard discrete-time specification uses an observed process or , a latent state process or , and a finite state space or . The defining TIHMM modification is that the transition probabilities depend on the index. In periodically inhomogeneous notation,
whereas in the SNP-sequence formulation the position-dependent transition model is written
The time-homogeneous special case is recovered when the transition matrix is constant, such as for all (Koslik et al., 2023, Rahimian et al., 7 Oct 2025).
The observation model need not be altered in the same way. In the SNP TIHMM, emissions are kept homogeneous over position,
0
with discrete SNP values encoded as 1. By contrast, in non-homogeneous HMMs for semi-supervised learning, the state-dependent observation model can itself be covariate-dependent, with
2
while the transition probabilities depend on covariates through a logistic form. Thus, TIHMMs encompass both transition-only inhomogeneity and joint transition-emission nonstationarity, depending on the formulation (Hubin, 2019, Rahimian et al., 7 Oct 2025).
A periodic TIHMM is a particularly structured case in which
3
so only 4 distinct transition matrices occur over a cycle. This periodic setting is central in statistical ecology, where diel or seasonal effects induce recurrent changes in latent switching dynamics (Koslik et al., 2023).
2. Sources and parameterizations of inhomogeneity
A first major source of inhomogeneity is periodic variation. In the periodic behavioral models, transition probabilities are modulated with trigonometric covariates. For a 24-hour cycle and 5,
6
In the fruit fly application, richer periodic structure with wavelengths 24, 12, and 8 hours is used. This parameterization encodes recurring phase-specific switching tendencies rather than a single stationary regime (Koslik et al., 2023).
A second source is sequence position. In the genomic TIHMM, the transition matrix depends explicitly on locus. The full transition sequence is represented as
7
with 8 an 9 matrix. The rationale given there is that SNP correlation structure is not uniform across the genome, so a single global transition model captures only broad averaged patterns, whereas 0 can preserve local correlations and behaviors more effectively (Rahimian et al., 7 Oct 2025).
A third source is irregular spacing in continuous time. In continuous-time HMMs, the latent process evolves according to a rate matrix 1, but posterior inference at observation times can be reformulated as a discrete-time inhomogeneous HMM. For interval 2, with 3, the interval-specific transition matrix is
4
The resulting discrete-time representation is inhomogeneous because each observation interval may have a different duration and hence a different transition matrix (Liu et al., 2021).
A fourth source is genuinely continuous-time inhomogeneity. In multistate Markov models and HMMs with misclassification, the generator may vary smoothly with time as 5, yielding forward equations of the form
6
The central complication is that no general analytic solution is available, in contrast to the homogeneous case 7. This is the setting in which numerical ODE solvers are advocated over piecewise-homogeneous approximations (Kendall et al., 2022).
A fifth, more structural, source arises when the model itself evolves online. In the “dynamical hidden Markov model” built from a signal automaton, the state space 8, the transition matrix 9, the emission model 0, and the initial distribution 1 are all time-indexed. This is effectively a TIHMM with evolving state-space topology rather than merely a fixed-state model with time-varying coefficients (Knapik, 2021).
3. Likelihoods, training procedures, and computational strategies
For discrete-time TIHMMs, the forward algorithm retains the usual dynamic-programming structure but uses time-indexed transitions. In the SNP model,
2
and the likelihood is
3
The training objective is the negative log-likelihood,
4
optimized by SGD in the non-private case and by DP-SGD in the privacy-preserving variant (Rahimian et al., 7 Oct 2025).
When differential privacy is required, the key mechanism is sequence-level clipping of per-example gradients,
5
followed by Gaussian perturbation and parameter updates. The privacy guarantee is standard 6-DP,
7
and the overall privacy budget across epochs is tracked using the Rényi Differential Privacy accountant. The privacy claim is therefore attached to the training procedure rather than to the HMM family itself (Rahimian et al., 7 Oct 2025).
In periodically inhomogeneous HMMs, inference is typically frequentist. The fruit fly model is fitted by maximum likelihood, random effects are marginalized out using numerical integration, and computation is implemented in R with parallelized optimization. Once fitted, the model yields phase-specific unconditional state distributions and dwell-time summaries, which are then compared with empirical dwell times from the Viterbi-decoded sequence as a model-checking device focused on latent-state dynamics (Koslik et al., 2023).
For non-homogeneous HMMs with covariate selection, the central problem is combinatorial model search over
8
with 9 possible inclusion configurations. The adaptive simulated annealing expectation maximization algorithm combines EM for parameter estimation with simulated annealing for model-space exploration, using acceptance probability
0
and exponential cooling 1. The paper emphasizes that this is a practical response to the scale of the search space, which exceeds 2 for 3 and 4 for 5 (Hubin, 2019).
In truly continuous-time inhomogeneous models with generator 6, likelihood evaluation is built around numerical ODE integration. The cited implementations include the R package deSolve and the nhm package. The methodological point is that piecewise-constant approximation is computationally convenient but exact only when the true process is actually piecewise-homogeneous; otherwise it can bias baseline coefficients and degrade confidence interval coverage (Kendall et al., 2022).
In CT-HMM learning, the E-step separates into posterior state probabilities at observation times and end-state conditioned sufficient statistics. The posterior part is solved by forward-backward or Viterbi on the equivalent TIHMM, and the sufficient-statistics part by Expm, Uniformization, or Eigen methods. The stated recommendation is to use soft Eigen by default, soft Expm when eigendecomposition is unstable, and hard Unif when a faster approximate hard method is needed (Liu et al., 2021).
4. Periodic stationarity, dwell times, and latent-state summaries
A central mathematical distinction between homogeneous HMMs and periodic TIHMMs is that the latter do not admit an ordinary stationary distribution. Instead, for each phase 7, one considers the thinned chain 8, which is homogeneous with transition matrix
9
If this thinned chain is irreducible, it has a unique stationary distribution 0 satisfying
1
with recursion
2
This phase-specific unconditional state distribution is the exact periodic analogue of stationarity (Koslik et al., 2023).
The same work shows that the frequently used approximation
3
is generally biased because it ignores historical evolution under earlier phase-specific transition matrices. This matters whenever the inferential target is the latent-state process rather than only the observation model (Koslik et al., 2023).
Periodic inhomogeneity also changes dwell-time behavior. For a stay in state 4 beginning at time 5, the dwell-time pmf is
6
Unlike the homogeneous HMM case, this need not be geometric and need not be monotonically decreasing. The overall dwell-time distribution in a periodically stationary chain is a mixture
7
with weights determined by the periodic stationary distribution and the entry probabilities into state 8. In the homogeneous special case, 9 reduces to the usual geometric law 0 (Koslik et al., 2023).
These results also guide model building. If periodic variation is present, a TIHMM can generate non-geometric dwell times without immediately moving to a hidden semi-Markov model. If the dwell-time distribution remains strongly non-geometric even after including periodic covariates, a hidden semi-Markov model may be more appropriate. This provides a diagnostic boundary between time-inhomogeneous HMMs and models with explicit duration structure (Koslik et al., 2023).
5. Relation to hidden semi-Markov models and neighboring model classes
Inhomogeneous hidden semi-Markov models (HSMMs) generalize TIHMMs by allowing dwell-time distributions themselves to vary with time or covariates. In the extended-state-space construction, an HSMM is approximated by an HMM on an enlarged state space 1, with block transition matrix 2. In that representation, the inhomogeneous HSMM becomes a TIHMM on the expanded state space. The resulting model retains standard HMM likelihood evaluation via the forward algorithm while encoding time-varying hazards 3 and conditional transition probabilities 4 (Koslik, 2024).
The periodic HSMM theory parallels the periodic TIHMM theory. Under
5
one again obtains a periodically varying stationary distribution from the thinned chain and an overall dwell-time distribution that is a mixture of phase-specific dwell-time laws. A key point in that literature is that TIHMMs are the computational and inferential backbone for inhomogeneous HSMMs, because the expanded-state representation makes the latter accessible with standard HMM machinery (Koslik, 2024).
The nonhomogeneous HSMM for toroidal data is richer than a TIHMM in a different sense: the discrete hazard depends on elapsed duration and time-varying covariates through a proportional hazards formulation,
6
Under constant hazards with no covariate effects, dwell times become geometric and the latent process collapses toward a Markov-chain representation that is closest to a TIHMM. In the general case, however, the model remembers time since entry and is therefore strictly richer than a memoryless TIHMM (Lagona et al., 2023).
Several neighboring models should not be conflated with TIHMMs. An HMM with a constant transition matrix and skew-normal emissions is explicitly time-homogeneous, even though the realized regime path is time-varying (Nigri et al., 24 Sep 2025). A countably infinite HDP-HMM for gene-expression trajectories is sequential and nonparametric, but it is not explicitly time-inhomogeneous because the transition distribution depends on the previous state rather than on the time index (Beal et al., 2012). Likewise, a model with homogeneous hidden dynamics but time-dependent observation noise yields an inhomogeneous observed process without making the hidden Markov chain itself time-inhomogeneous (Diehn et al., 2018).
6. Empirical behavior and application domains
In privacy-preserving genomics, TIHMMs are used to synthesize SNP sequences while protecting sequence-level privacy. On the 1000 Genomes Project integrated phased biallelic SNP dataset, with 2,548 individuals, chromosomes X and 22, and sequence lengths 7, the non-private TIH model outperformed the time-homogeneous baseline on distance measures and achieved Nei’s distance below 8 in many cases. In the DP setting with 9 and 0, GRR performed worst across all metrics, DP-trained TIH models consistently outperformed GRR, larger 1 improved fidelity, and 2 was repeatedly the best tradeoff. The paper’s interpretation is that locus-dependent transitions better match local LD structure and generate synthetic data much closer to the original data than time-homogeneous HMMs (Rahimian et al., 7 Oct 2025).
In statistical ecology, the fruit fly study uses a 2-state periodically inhomogeneous HMM on 6,840 half-hour observations from 15 male Drosophila melanogaster under LD and DD conditions. The exact periodic stationary distribution 3 differs substantially from the approximate 4, shifting activity peaks about 1–3 hours earlier under the approximation. The fitted time-varying dwell-time distributions show morning activity bouts with a mode away from 1 in LD, shorter bouts around noon and early afternoon, and a bimodal overall high-activity dwell-time distribution in DD. The significance of this example is methodological as well as biological: periodic inhomogeneity alone can induce rich dwell-time structure that a homogeneous HMM cannot capture (Koslik et al., 2023).
In disease progression modeling, CT-HMMs with irregular visit times become TIHMMs after discretization at observation times. The cited work reports applications with 105 states on a glaucoma dataset and 277 states on an Alzheimer’s disease dataset, and states that soft Eigen was about 26× faster than soft Expm on the glaucoma data and about 35× faster on the Alzheimer’s data. These results illustrate a recurring theme in TIHMM research: time inhomogeneity often enters through observation geometry or continuous-time latent dynamics rather than through arbitrary direct parameterization of the discrete-time transition matrices (Liu et al., 2021).
In covariate-driven regime models, non-homogeneous HMMs have been used for epigenetic and financial data. The selected binomial 2-state model in the epigenetic example uses 5 and 6 in the observation model and 7 and 8 in the transition model, while the Gaussian 3-state financial example uses 30 covariates and interprets the latent states as wait, buy, and sell. These examples emphasize that TIHMMs can serve both explanatory and predictive roles when temporal nonstationarity is induced by exogenous covariates rather than by fixed calendar phase alone (Hubin, 2019).
A recurring misconception is that any nonstationary HMM is a TIHMM. The literature is more specific. Time-varying emissions with a constant transition matrix do not constitute a TIHMM in the strict transition-dynamics sense (Nigri et al., 24 Sep 2025). Homogeneous hidden dynamics with inhomogeneous observation noise produce a nonstationary observed process but not a time-inhomogeneous hidden chain (Diehn et al., 2018). Conversely, continuous-time models with constant generator 9 may induce a discrete-time inhomogeneous representation at irregular observation intervals, even though the latent continuous-time process is homogeneous (Liu et al., 2021). This suggests that “time-inhomogeneity” in HMMs is best understood at the level of the effective transition law on the analysis timescale, not merely at the level of visible nonstationarity.