WorksMathematics
Hidden Semi-Markov Models for Fully Functional Time Series
Abstract
Functional time series have a wide range of practical applications to modeling complex datasets such as Electroencephalogram (EEG) and other biological signals. Often latent states are hidden within the data dictating how a system is behaving and changing over time. The Hidden Markov Model (HMM) is one common and highly applicable latent state space model where the hidden state sequence evolves as a Markov chain. While the HMM has had much success modeling discrete, multivariate, and fully functional time series, it is also restricted by the Markov property which causes hidden states to persist only at geometrically decaying rates. This work investigates the implementation of hidden semi-Markov models for modeling fully functional time series data. This allows for the hidden state sequence to persist in a given state for a data-driven sojourn time, which can be parametrized by a discrete distribution (e.g. negative binomial) or left non-parametric. For efficient fitting of such a model, the hidden semi-Markov chain is embedded into a larger state space Markov chain and classic methods like the Baum-Welch and Viterbi algorithms are applied. We furthermore consider functional time series in the general setting of Gaussian measures in locally convex topological vector spaces. This is applied to a time series of pediatric EEG signals collected via overnight polysomnography.
Introduction
The Hidden Markov Model (HMM) remains one of the most widely used tools for modelling sequential data. Its origins lie in the work of Leonard Baum and his colleagues [1, 2], which predates the formalization of the expectation-maximization (EM) algorithm [3, 4]. Originally developed for observations taking values in a finite alphabet, with early applications in speech recognition [5, 6, 7], the HMM has since been extended to multivariate elliptically symmetric [8] and skewed [9] emission distributions, to longitudinal data [10], to nonparametric emission densities [12] [11], and to functional data [13, 14]. Most recently, [15] extended the observation space of the HMM from Euclidean space to general locally convex topological vector spaces, in which each hidden state corresponds to a mean-shifted Gaussian measure. As there is no analogue of Lebesgue measure, and hence no probability density, in infinite-dimensional spaces, their Topological Hidden Markov Model (THMM) replaces the emission density with the Onsager–Machlup functional of the underlying Gaussian measure [16, 17]. This allows the analyst to select a Cameron–Martin space suited to the application at hand, and the THMM was shown to successfully cluster sample paths of Brownian motion with drift, fractional Brownian motion, and the Ornstein–Uhlenbeck process, as well as nonparametric curves such as the power spectral densities of electroencephalogram (EEG) signals.
For all of its flexibility in the observation space, the THMM inherits a structural restriction of the classic HMM in its hidden component. Since the hidden state sequence evolves as a homogeneous Markov chain with transition probabilities , the number of consecutive time points that the chain spends in state , known as the dwell time or sojourn time , necessarily follows a geometric distribution,
Consequently, regardless of the value of , the modal dwell time of every state is a single time step, and the probability of leaving a state does not depend on how long the chain has already occupied it [6, 18]. This memoryless behavior is unrealistic in many applications. The THMM was applied to overnight polysomnography data from pediatric patients, the Viterbi path switched between the awake and asleep states considerably more often than the sleep stages labeled by a sleep technician. [15] attributed this behavior to the geometric dwell-time assumption and identified hidden semi-Markov models as a natural remedy.
Hidden semi-Markov models (HSMMs) remove this restriction by modelling the dwell times explicitly. Upon entering state , the hidden process remains there for a duration drawn from an arbitrary distribution on the positive integers, after which it moves to a new state according to an embedded Markov chain with no self-transitions [5, 19, 20]. The HMM is recovered as the special case in which every is geometric. Originally proposed for speech recognition, HSMMs have since been applied to rainfall [21], financial returns [22], and animal movement [23], among many other areas; see [24] for a comprehensive review. Parameters are typically estimated via an EM algorithm adapted to the semi-Markov setting [25, 26], and implementations are available in R [27, 28]. This additional generality is not free, however. The forward–backward recursions of an HSMM must account for every possible duration, so the cost of evaluating the likelihood can grow quadratically in the length of the series in the worst case [25]. Furthermore, as state changes and state durations are modeled separately, the hidden process is no longer Markovian on the original time scale. This complicates the inclusion of covariates, forecasting, and the fitting of stationary models, and most implementations assume that the observed series begins, and possibly ends, at a state boundary.
An elegant alternative, proposed by [18] and building on earlier ideas of state aggregation [29, 30, 31, 32], is to partially embed the HSMM as an HMM on an enlarged state space. Each semi-Markov state is replaced by a state aggregate of Markov substates that share a common emission distribution, and the transitions within and out of the aggregate are governed by the discrete hazard rates of the dwell-time probability mass function,
where denotes the cumulative distribution function of . The dwell-time distribution of the resulting HMM coincides with for durations of up to time steps and has a geometric tail thereafter. Hence, the representation is exact for dwell-time distributions with finite support or with geometric tails, and it can be made arbitrarily accurate for all others by enlarging . The expanded model has exactly as many parameters as the HSMM it represents, its likelihood can be evaluated in time linear in the length of the series, and, being an HMM, it inherits the full toolkit of HMM methodology—forward–backward recursions, Viterbi decoding, stationary initial distributions, and state prediction—without modification.
In this article, we unite these two lines of research and propose the Topological Hidden Semi-Markov Model (THSMM). As in the THMM, observations may take values in a general locally convex space, encompassing finite-dimensional data, functional data, and sample paths of stochastic processes among others. Each hidden state corresponds to a mean-shifted Gaussian measure, and emissions are evaluated through the Onsager–Machlup functional. Unlike the THMM, each hidden state is additionally endowed with its own dwell-time distribution. These may be drawn from parametric families such as the (shifted) Poisson, (shifted) negative binomial, or discretized Weibull distributions, or they may be left nonparametric, either on a finite support or with an unstructured start and a geometric tail in the spirit of [21]. The semi-Markov structure is implemented via the state-aggregate construction of [18].
A key feature of this construction is that the two extensions decouple cleanly. Since every substate in an aggregate shares the same Onsager–Machlup emission functional, the topological component of the model enters only through the emission terms, whereas the semi-Markov component enters only through the structured transition matrix. As a result, the posterior probability of occupying a given semi-Markov state is simply the sum of the posterior probabilities of its substates, and the state means are re-estimated by the same weighted criteria as in the THMM, with these aggregate posterior probabilities serving as the weights. The THMM is recovered when every dwell-time distribution is geometric, and the classic HSMM with Gaussian emissions sharing a common covariance matrix is recovered when the observation space is .
To our knowledge, explicit modeling of state durations has received little attention outside of finite-dimensional observation spaces. Existing HMMs for functional data, such as [13, 14], do not model the state durations explicitly, while existing HSMM methodology, including Bayesian nonparametric variants [33], assumes emission distributions that admit densities with respect to Lebesgue or counting measure.
The THSMM fills this gap, allowing realistic sojourn behaviour to be modelled jointly with emissions living in infinite-dimensional spaces. We demonstrate the THSMM on simulated diffusion processes whose hidden states have non-geometric dwell times, and we revisit the pediatric obstructive sleep apnea polysomnography data of [15] to show how explicit dwell-time modelling affects the predicted sequence of sleep states.
The remainder of this article is organized as follows. § 2 outlines the general theory for using HSMMs with functional data. § 3 reviews [18] and proposes an EM framework for model fitting. § 4 explores various simulated data sets to give a comprehensive overview of the models capabilities. § 5 applies the THSMM to the identification of sleep states form pediatric EEG data. For pseudo code of algorithms and in depth derivations please reference Appendices A and § 9.
HSMM for functional data
In this section we define a HSMM that utilizes functional data (THSMM); even though this construction is quickly dissembled in the next section it is important to fully establish it. For an in depth study of the HSMM, extensions, and case studies, we refer the reader to [24].
Let be a sequence of observations taking values in a locally convex topological vector space , and let be an unobserved state sequence taking values in . As in the THMM [15], the observations are assumed conditionally independent given the hidden states, and the conditional law of given is a Gaussian measure on with state-specific mean and a shared covariance structure. Unlike the THMM, the hidden process is not assumed to be a Markov chain on the original time scale; instead it is a semi-Markov chain whose dwell times are modelled explicitly, see Figure 1. We describe the hidden component in § 2.1, the emission component in § 2.2, and the resulting likelihood and its HMM representation in § 3.

Figure 1. An example of a semi-Markov process where the state process is determined by transition probability matrix and stationary distribution and the duration of the stay is determined by .
The Hidden Semi-Markov Chain
The hidden process is described by two components. The first is an embedded Markov chain governing which state is visited next, with transition probability matrix (tpm) ,
That is, is the probability of moving to state given that the process leaves state ; self-transitions are excluded, since the time spent in a state is governed entirely by the second component. We assume is irreducible and denote its stationary distribution by ; i.e. and . Note that is the long-run proportion of visits to state , not the long-run proportion of time spent there; the two are related in Remark 2.
The second component is a collection of dwell-time (or sojourn) distributions. Let , , denote the probability mass function of the dwell time in state , and its cumulative distribution function. Upon entering state , the process remains there for a random number of time steps with probability after which it moves to a new state with probability . We write
for the survival function and the discrete hazard rate of , with the convention whenever . The hazard is the probability that a sojourn in state ends after exactly steps, given that it has lasted at least steps, in this sense it can be viewed as a sort of right censoring. Notice that this definition coincides with the quantity of Equation (2). Dwell times of successive visits are independent of one another and of the embedded chain.
The dwell-time distributions may be drawn from any family on the positive integers. Those considered in this article—the geometric, (shifted) Poisson, (shifted) negative binomial, discretized Weibull, and nonparametric distributions with or without a geometric tail—are detailed in § 3. In the special case , the hazard is constant, the process is memoryless, and is a homogeneous Markov chain with transition probabilities
Emissions via the Onsager–Machlup functional
The emission component is inherited unchanged from the THMM; we summarize it here and refer to [15] for details. Let be a centred Radon Gaussian measure on with covariance operator and Cameron–Martin space , equipped with norm . Conditional on , the observation is modelled as
so that each hidden state corresponds to a shift of the common Gaussian measure by a state mean in an appropriate Cameron–Martin space. Since is in general infinite-dimensional, the law of has no density with respect to a sigma-finite translation invariant measure (e.g. Lebesgue measure), and we instead use the Onsager–Machlup functional of as the emission function,
where is the -ball of a seminorm on , and is the orthogonal projection in onto the orthogonal complement of [17 Corollary 4.7.8]. When is a norm, is the identity and (7) reduces to .
The choice of , and hence of , is left to the analyst. For example, when and , we have and is, up to a constant, the Gaussian density with mean and common covariance . When is the Wiener measure on , and
and analogous expressions are available for Brownian motion with drift, the Ornstein–Uhlenbeck process, and fractional Brownian motion [15] § 4.
Remark 1 (Why the Onsager–Machlup functional suffices) Fix and replace each emission density in the HSMM likelihood by the small-ball probability . Every time point contributes exactly one emission factor, regardless of how the sequence is partitioned into sojourns, so dividing this small-ball likelihood by —a constant free of all model parameters—and letting term by term in the finite sum over state sequences yields the analogue of the likelihood in Equation (12) below, in which each emission is the Onsager–Machlup functional (7). Hence the justification of [15] carries over to the semi-Markov setting without modification: the semi-Markov structure alters only the weights placed on each state sequence, not the emission terms.
HMM Embedding
The work of [18] consider specially structured HMMs that capture — up to an approximation — the sojourn distribution component of a HSMM. Below we give a brief summary of the technique, the advantages and disadvantages associated, and an extension for the use of the Baum-Welch algorithm for parameter estimation as opposed to the numerical maximization approach used in the original work.
HMMs with Arbitrary State Dwell-Time Distributions
We begin by outlining the technique. Let the -state HSMM be represented by , a state dependent process with realizations and Markov chain with realizations prescribing to tpm . For each state define the size of a state aggregate , with . Consider the HMM with state dependent process , Markov chain with states . Refer to the sets
as state aggregates and define and . The state aggregate is the index set corresponding to HMM states associated with state of the HSMM. Assume that HMM states in aggregate are associated with the same emission distribution , that is
Define the hazard rate function by:
Where , and the censoring factor. The hazard rate is how the sojourn distribution is embedded in the HMM construction.
Denote the HMM tpm by and construct it as follows. Build a block matrix (8) whose th block is size . We populate the blocks (9) and (10) using the hazard rates in such a way that the sojourn distribution is exactly embedded in the HMMs Markov chain up to a duration less than or equal to its respective aggregate size.
The diagonal block , are defined, for , as
where the entries to are along the super diagonal. The off diagonal blocks are defined as
There are two important consequences of this construction. Firstly the state transitions between aggregates in the HMM align with the state transitions in the HSMM. Specifically, for , , . Furthermore, the duration with state aggregate corresponds to the sojourn distribution for state up to a duration and has geometric decay thereafter. That is, for any
The geometric decay is a direct consequence of Markov chain behavior. One can see that the difference between and can be made arbitrarily small by choosing sufficiently large. Also, any sojourn distribution with finite support can be exactly recreated by choosing to be the maximum dwell time in state having a non-zero probability.
Let be the collection of model parameters. A state sequence may be written uniquely as a sequence of sojourns , where is the state visited in the -th sojourn, its length, , and . If the series is assumed to begin at the start of a sojourn, with , the probability of is
where the survival function in the final factor accounts for the last sojourn being right-censored at time . The log likelihood of the THSMM is then
Direct evaluation of (12) through the semi-Markov forward recursion requires summing over all possible sojourn lengths at each time step, at a cost that grows quadratically in in the worst case [25]. Moreover, (11) requires the series to begin at a sojourn boundary; relaxing this is awkward because is not Markov on the original time scale. Both issues are resolved by the state-aggregate representation.
Remark 2 (Stationarity) Let denote the mean dwell time in aggregate , and suppose for every . The stationary distribution of is
normalized to sum to one. Summing over each aggregate, the stationary probability of hidden state is
so that the long-run proportion of time spent in state is the proportion of visits to state under the embedded chain, reweighted by the mean dwell time of state .
The usefulness of such a construction is that by porting a HSMM into a HMM the user immediately gains access to a wide array of well established HMM theory. Of particular interest is that it greatly simplifies the likelihood of a HSMM and in turn the maximization of such a likelihood. One now has a greatly simplified modular framework that supports a wide range of sojourn distributions without the need for custom infrastructure. This is well demonstrated in [18] where a maximization of a HSMM over many different sojourn distributions can be done with a simple numerical maximization of the constructed HMM likelihood without the need for significant tailoring of the algorithm. One simply needs to build the hazard rate equations for any specific sojourn they wish to use.
The expanded state space does not increase the size of the parameter space as the HMM formulation of a deterministic function of and the dwell parameters from the HSMM and therefore there are as many constrained parameters in both models. Computational slowdown in this expanded state space can be mitigated via sparse matrix computations (in C++ or in R using package TMB [34]) yielding speedups in runtime over the naive implementation.
Model Fitting Via Baum-Welch (EM algorithm):
Unlike in the original work of [18] we fit the HSMM (embedded into a HMM) via the Baum-Welch algorithm. This is for two reasons: the first being that direct numerical maximization of the parameters for a measure in an infinite dimensional space is often ill-posed whereas the M-step in Baum-Welch provides a closed form solution. Additionally, we can derive closed for updates for the hazard rates and in turn the tpm , and weighted least square estimates (WLSE) for sojourn distributions. Throughout the optimization there is no need to construct circumventing the issue of doing computations with large matrices.
In the proceeding discussion we introduce the following notation to describe state transitions in . Define to be the probability of transitioning from the -th entry of state aggregate to the -th entry of state aggregate . There are only two such transitions, advance within a state aggregate with probability:
or advance to a new aggregate with probability
All remaining entries of being equal to zero. Note that we need the construction to appropriately deal with the geometric tail of a state aggregate.
The forward () and backwards () equations handle the expectation step of the Baum-Welch algorithm and are defined as follows:
Before calculating these probabilities it is useful to define the following:
Where Equation (13) can be seen as the total probability mass leaving aggregate at time weighted by the hazard and summed over the substates, and Equation (14) can be seen as the probability of all the data after time given that state ends at time . We then formulate the recursions for the and passes as follows:
Case by case we have the following situations for :
The first form of each pass handles the probability of advancing within a state aggregate and the second term handles the probability of leaving an aggregate. Using the Equations (15) and (16), we can iteratively produce the necessary posterior probabilities that act as weights in the maximization step.
To derive estimates for the hazard rates and the HSMM tpm entries we need to keep track of two things, how often the chain remained in a state and how often the chain left a state. We define the following counts:
Where represents the number of visits to state , represents the number of departures from state that happened at duration , and the total number of jumps from state to state . In addition, let the smoothed posterior probabilities be
Denote the full log likelihood of the HMM by :
We then define as the expected value of the log likelihood :
Estimates are then found by maximizing the specific summand of corresponding to those respective parameters and any constraints surrounding them.
HSMM transition probabilities are updated by maximizing subject to the constraint and are calculated as follows:
One can then either find the stationary distribution of the HSMM or update the initial distribution for the HMM via the EM. Assuming the initial distribution puts mass only on the first substate of each state, that is and for , we can rewrite as:
Which can be maximized subject to the constrain that , yielding:
Emission functions are updated the same as in [15] and we refer to the reader there for a detailed summary of derivations. A condensed update schema can be found in B for each functional emission satisfying:
The final component is to maximize the sojourn parameters. Recall the component of that corresponds to sojourn distributions:
At each duration there are “trials” and “successes” with the probability of success (a departure) being . In this view this is the log likelihood of a Binomial distribution. We can then develop update equations for families of sojourn distributions.
Non-Parametric (NP) Sojourn Distribution Updates: Each is a free parameter that can be maximized individually. We start by finding the hazard rate update:
then convert back to probabilities:
When the NP sojourn has no tail, the process must leave the state at or before duration . Thus,
yielding the desired property of no tail. When the NP sojourn has a tail, the decay of staying within the state is a geometric distribution, and we have:
If , then the Markov chain has an absorbing state in aggregate duration . For numerical stability, it is best to initialize the parameters away form zero as the EM algorithm will not be able to move it.
Geometric Sojourn Distribution Updates: A single hazard governs the probabilities of transitions. Thus we have:
Parametric Sojourn Distribution Updates: Here we encompass various families such as Poisson, Negative Binomial, and Weibull. In the case of a sojourn distribution that follows one of the preceding distributions, the hazard rate is a curve or for short parameterized by a vector . This becomes:
We can now update each via Iteratively Reweighted Least Squares (IRLS). Differentiating a single term of with respect to gives:
and summing over gives the score:
Using the reasoning above and treating as a Binomial(), we can compute the Hessian and the resulting Fisher information as follows.
Summing over yields the Hessian:
Finally the Fisher information matrix is:
Writing , the Fisher information is , a nonnegative combination of rank-one positive semi-definite matrices.
Hence , so is positive semi-definite. It is positive definite, and therefore invertible, if and only if the gradients span the parameter space; this requires at least durations with and . In that case is an ascent direction for , since whenever . In practice a small ridge, , guards against near-singularity. The IRLS update for is then:
The above equations entail all the necessary components for THSMM model fitting via the Baum-Welch algorithm. For details please refer to Appendix A. For pseudo-code of the implementation please refer to B.
Remark 3 (IRLS and EM guarantee) [3] show that the observed-data log-likelihood satisfies , so, any update that does not decrease also does not decrease . This motivates the generalized EM (GEM) algorithm, which relaxes the M step from fully maximizing to merely increasing it. IRLS, initialized at the current estimate , satisfies this condition provided each step increases ; this holds when is concave in the regression parameters (e.g., under a canonical link) or can be enforced by step-halving. Hence IRLS need not be run to convergence, and even a single safeguarded step yields a valid GEM iteration.
Simulation Experiments
In the following sections we stress test the THSMM in a variety of settings. To focus on comparability and keep results concise we keep our attention to emission distributions of nonparametric mean curves with various sojourn distributions. Further simulations can be found in the repository where we extensively test homogeneous mixtures of Brownian motion with linear drift, the Ornstein-Uhlenbeck process, and fractional Brownian motion with linear drift where the hidden process is a semi-Markov process. These simulations confirm that imposing the geometric distribution on the THSMM semi-Markov sojourn does computationally agree with the model fitted by the THMM—via the funHMM CRAN package—as expected mathematically. They also demonstrate how the THSMM can outperform other models when the sojourn distribution is correctly specified or left as nonparametric.
For each scenario we perform 50 replications. Each replicate has its own seed for data generation reproducibility. To evaluate model performance, we analyze overall performance accuracy and quality of parameter recovery. For performance accuracy, we use the adjusted Rand index (ARI) as our performance metric. The ARI is a popular method of measuring the agreement between two sets of labels and is computed in R via the adjustedRandIndex() function in the mclust package [35]. An ARI value of 1 indicates a perfect match whereas an ARI value of 0 indicates random guessing. We secondly compare clustering accuracy using cross entropy as an alternative measurement. To assess the parameter recovery, we calculate bias, standard deviation, and root mean squared error (RMSE), of fitted values from the 50 replications. Note that this is not a bootstrapped estimate as a fresh synthetic data set is generated from the same set of base parameters for each replicate. We point the reader to the repository for code to build and fit a THSMM as well as further simulations (repository link).
Data Generation Procedures
Each dataset has three states and transitions are uniform across states (jump from state to with probability for ). Given its hidden state , each observation is a curve on 100 equispaced points of of the form
so that the noise is a smooth Brownian bridge truncated to 16 terms of its Karhunen–Loève expansion and is the same for every state. The state mean curves are , and , where , and give low, medium and high separation between the states. Each of the proceeding sections then modifies the sojourn distributions for each state in order to better test the question at hand. For Sections 4.1 and 4.2 use a homogeneous mixture of sojourns and in Section 4.3 we also consider a heterogeneous mixture of sojourns where each state has its own unique distribution. See Figure 2 for an example of a synthetic data set where we used geometric sojourn distributions with low separation between observations within states.
Figure 2. Synthetic non parametric curves generated with low separation.
Remark 4 (Mixtures of Sojourn Distributions) The current implementation of THSMM supports the choice of a unique sojourn distribution for each state; e.g. the user could specify shifted Poisson, Geometric, and Negative Binomial for states 1, 2, and 3, respectively. In practice, this is useful as each family has its own benefits. For example, if in our data we see two states with long and consistent sojourn distributions then we may want to use a Shifted Poisson or a Negative Binomial for those states. But if we see that a specific state has a very unstable sojourn then it may be the case that a nonparametric or a geometric sojourn is more suitable. Thus the combination of sojourns will yield the most natural parameterization. This obviously comes at the expense of doing quite a bit of data analytics before fitting the model (but this is often the case anyways). Future work is aimed at building initialization procedures that can suggest or even automatically choose the the most suitable sojourn distribution for each state.
THMM Recovery
A natural question to ask is if the THSMM can recover a THMM. To this extent we generate synthetic data where each state has a geometric sojourn distribution. We then fit three models, a THMM, a THSMM with homogeneous geometric sojourn distributions, and a THSMM with homogeneous negative binomial distributions, where an aggregate size of was used for each state of the THSMM. In this sense the THSMM with geometric sojourns should be able to exactly recover the THMM and the THSMM with negative binomial should be able to get quite close, as a geometric distribution is a special case of a binomial distribution. See Table C2 for various statistics of the fitted models over 50 replications. As expected, the THSMM reproduces the THMM exactly when geometric sojourns are used, see Figure 3 for plots of the fitted sojourns.

Figure 3. Fitted sojourn distribution per state for THMM, and THSMMs on nonparametric curves with geometric sojourn distributions.
| Sep. | Method | State | Parameter | True | Mean | Bias | SD | RMSE |
| low | THMM | 1 | mean curve RMSE | 0 | 0.148 | 0.148 | 0.0683 | 0.162 |
| low | THMM | 1 | mean dwell | 2.5 | 2.11 | -0.391 | 1.01 | 1.07 |
| low | THMM | 1 | prob | 0.4 | 0.556 | 0.156 | 0.191 | 0.245 |
| low | THMM | 1 | TV dwell | 0 | 0.227 | 0.227 | 0.115 | 0.254 |
| low | THMM | 2 | mean curve RMSE | 0 | 0.0695 | 0.0695 | 0.0283 | 0.0749 |
| low | THMM | 2 | mean dwell | 4 | 5.82 | 1.82 | 2.79 | 3.31 |
| low | THMM | 2 | prob | 0.25 | 0.243 | -0.00728 | 0.167 | 0.165 |
| low | THMM | 2 | TV dwell | 0 | 0.246 | 0.246 | 0.0967 | 0.264 |
| low | THMM | 3 | mean curve RMSE | 0 | 0.0432 | 0.0432 | 0.0215 | 0.0482 |
| low | THMM | 3 | mean dwell | 6.67 | 5.57 | -1.09 | 2.94 | 3.11 |
| low | THMM | 3 | prob | 0.15 | 0.26 | 0.11 | 0.169 | 0.2 |
| low | THMM | 3 | TV dwell | 0 | 0.223 | 0.223 | 0.187 | 0.29 |
| low | THSMM-G | 1 | mean curve RMSE | 0 | 0.148 | 0.148 | 0.0683 | 0.162 |
| low | THSMM-G | 1 | mean dwell | 2.5 | 2.11 | -0.391 | 1.01 | 1.07 |
| low | THSMM-G | 1 | prob | 0.4 | 0.556 | 0.156 | 0.191 | 0.245 |
| low | THSMM-G | 1 | TV dwell | 0 | 0.227 | 0.227 | 0.115 | 0.254 |
| low | THSMM-G | 2 | mean curve RMSE | 0 | 0.0695 | 0.0695 | 0.0283 | 0.0749 |
| low | THSMM-G | 2 | mean dwell | 4 | 5.82 | 1.82 | 2.79 | 3.31 |
| low | THSMM-G | 2 | prob | 0.25 | 0.243 | -0.00728 | 0.167 | 0.165 |
| low | THSMM-G | 2 | TV dwell | 0 | 0.246 | 0.246 | 0.0967 | 0.264 |
| low | THSMM-G | 3 | mean curve RMSE | 0 | 0.0432 | 0.0432 | 0.0215 | 0.0482 |
| low | THSMM-G | 3 | mean dwell | 6.67 | 5.57 | -1.09 | 2.94 | 3.11 |
| low | THSMM-G | 3 | prob | 0.15 | 0.26 | 0.11 | 0.169 | 0.2 |
| low | THSMM-G | 3 | TV dwell | 0 | 0.223 | 0.223 | 0.187 | 0.29 |
| low | THSMM-NB | 1 | mean curve RMSE | 0 | 0.148 | 0.148 | 0.0689 | 0.163 |
| low | THSMM-NB | 1 | mean dwell | 2.5 | 2.25 | -0.252 | 1.29 | 1.3 |
| low | THSMM-NB | 1 | prob | 0.4 | 0.574 | 0.174 | 0.196 | 0.261 |
| low | THSMM-NB | 1 | size | 1 | 15.6 | 14.6 | 98.8 | 98.9 |
| low | THSMM-NB | 1 | TV dwell | 0 | 0.268 | 0.268 | 0.122 | 0.294 |
| low | THSMM-NB | 2 | mean curve RMSE | 0 | 0.0677 | 0.0677 | 0.0268 | 0.0727 |
| low | THSMM-NB | 2 | mean dwell | 4 | 6.3 | 2.3 | 3.11 | 3.85 |
| low | THSMM-NB | 2 | prob | 0.25 | 0.379 | 0.129 | 0.21 | 0.244 |
| low | THSMM-NB | 2 | size | 1 | 2.75e+08 | 2.75e+08 | 1.95e+09 | 1.95e+09 |
| low | THSMM-NB | 2 | TV dwell | 0 | 0.378 | 0.378 | 0.131 | 0.4 |
| low | THSMM-NB | 3 | mean curve RMSE | 0 | 0.0447 | 0.0447 | 0.0231 | 0.0502 |
| low | THSMM-NB | 3 | mean dwell | 6.67 | 5.73 | -0.934 | 3.24 | 3.34 |
| low | THSMM-NB | 3 | prob | 0.15 | 0.373 | 0.223 | 0.227 | 0.316 |
| low | THSMM-NB | 3 | size | 1 | 1.35e+11 | 1.35e+11 | 9.54e+11 | 9.54e+11 |
| low | THSMM-NB | 3 | TV dwell | 0 | 0.317 | 0.317 | 0.154 | 0.352 |
| medium | THMM | 1 | mean curve RMSE | 0 | 0.0501 | 0.0501 | 0.0864 | 0.0991 |
| medium | THMM | 1 | mean dwell | 2.5 | 2.76 | 0.262 | 0.548 | 0.602 |
| medium | THMM | 1 | prob | 0.4 | 0.383 | -0.0168 | 0.113 | 0.114 |
| medium | THMM | 1 | TV dwell | 0 | 0.0984 | 0.0984 | 0.0774 | 0.125 |
| medium | THMM | 2 | mean curve RMSE | 0 | 0.0241 | 0.0241 | 0.0208 | 0.0317 |
| medium | THMM | 2 | mean dwell | 4 | 5.39 | 1.39 | 0.931 | 1.67 |
| medium | THMM | 2 | prob | 0.25 | 0.19 | -0.0596 | 0.0293 | 0.0663 |
| medium | THMM | 2 | TV dwell | 0 | 0.117 | 0.117 | 0.0639 | 0.133 |
| medium | THMM | 3 | mean curve RMSE | 0 | 0.0176 | 0.0176 | 0.0166 | 0.0241 |
| medium | THMM | 3 | mean dwell | 6.67 | 7.14 | 0.478 | 1.84 | 1.88 |
| medium | THMM | 3 | prob | 0.15 | 0.164 | 0.0142 | 0.102 | 0.102 |
| medium | THMM | 3 | TV dwell | 0 | 0.0968 | 0.0968 | 0.125 | 0.157 |
| medium | THSMM-G | 1 | mean curve RMSE | 0 | 0.0501 | 0.0501 | 0.0864 | 0.0991 |
| medium | THSMM-G | 1 | mean dwell | 2.5 | 2.76 | 0.262 | 0.548 | 0.602 |
| medium | THSMM-G | 1 | prob | 0.4 | 0.383 | -0.0168 | 0.113 | 0.114 |
| medium | THSMM-G | 1 | TV dwell | 0 | 0.0984 | 0.0984 | 0.0774 | 0.125 |
| medium | THSMM-G | 2 | mean curve RMSE | 0 | 0.0241 | 0.0241 | 0.0208 | 0.0317 |
| Sep. | Method | State | Parameter | True | Mean | Bias | SD | RMSE |
| medium | THSMM-G | 2 | mean dwell | 4 | 5.39 | 1.39 | 0.931 | 1.67 |
| medium | THSMM-G | 2 | prob | 0.25 | 0.19 | -0.0596 | 0.0293 | 0.0663 |
| medium | THSMM-G | 2 | TV dwell | 0 | 0.117 | 0.117 | 0.0639 | 0.133 |
| medium | THSMM-G | 3 | mean curve RMSE | 0 | 0.0176 | 0.0176 | 0.0166 | 0.0241 |
| medium | THSMM-G | 3 | mean dwell | 6.67 | 7.14 | 0.478 | 1.84 | 1.88 |
| medium | THSMM-G | 3 | prob | 0.15 | 0.164 | 0.0142 | 0.102 | 0.102 |
| medium | THSMM-G | 3 | TV dwell | 0 | 0.0968 | 0.0968 | 0.125 | 0.157 |
| medium | THSMM-NB | 1 | mean curve RMSE | 0 | 0.05 | 0.05 | 0.0854 | 0.0982 |
| medium | THSMM-NB | 1 | mean dwell | 2.5 | 2.88 | 0.377 | 0.576 | 0.684 |
| medium | THSMM-NB | 1 | prob | 0.4 | 0.492 | 0.0917 | 0.158 | 0.181 |
| medium | THSMM-NB | 1 | size | 1 | 2.18 | 1.18 | 1.72 | 2.07 |
| medium | THSMM-NB | 1 | TV dwell | 0 | 0.162 | 0.162 | 0.0849 | 0.183 |
| medium | THSMM-NB | 2 | mean curve RMSE | 0 | 0.0243 | 0.0243 | 0.0207 | 0.0318 |
| medium | THSMM-NB | 2 | mean dwell | 4 | 5.63 | 1.63 | 0.934 | 1.87 |
| medium | THSMM-NB | 2 | prob | 0.25 | 0.289 | 0.0389 | 0.097 | 0.104 |
| medium | THSMM-NB | 2 | size | 1 | 1.92 | 0.918 | 0.904 | 1.28 |
| medium | THSMM-NB | 2 | TV dwell | 0 | 0.207 | 0.207 | 0.0679 | 0.218 |
| medium | THSMM-NB | 3 | mean curve RMSE | 0 | 0.0179 | 0.0179 | 0.0175 | 0.0249 |
| medium | THSMM-NB | 3 | mean dwell | 6.67 | 7.36 | 0.692 | 1.95 | 2.05 |
| medium | THSMM-NB | 3 | prob | 0.15 | 0.212 | 0.0621 | 0.145 | 0.157 |
| medium | THSMM-NB | 3 | size | 1 | 1.52 | 0.524 | 0.744 | 0.903 |
| medium | THSMM-NB | 3 | TV dwell | 0 | 0.155 | 0.155 | 0.122 | 0.197 |
| high | THMM | 1 | mean curve RMSE | 0 | 0.0106 | 0.0106 | 0.00361 | 0.0112 |
| high | THMM | 1 | mean dwell | 2.5 | 2.58 | 0.0802 | 0.246 | 0.257 |
| high | THMM | 1 | prob | 0.4 | 0.391 | -0.00885 | 0.0386 | 0.0393 |
| high | THMM | 1 | TV dwell | 0 | 0.0394 | 0.0394 | 0.0265 | 0.0473 |
| high | THMM | 2 | mean curve RMSE | 0 | 0.00901 | 0.00901 | 0.00351 | 0.00965 |
| high | THMM | 2 | mean dwell | 4 | 4.18 | 0.177 | 0.404 | 0.437 |
| high | THMM | 2 | prob | 0.25 | 0.242 | -0.00831 | 0.0245 | 0.0257 |
| high | THMM | 2 | TV dwell | 0 | 0.0357 | 0.0357 | 0.0267 | 0.0445 |
| high | THMM | 3 | mean curve RMSE | 0 | 0.00688 | 0.00688 | 0.00269 | 0.00737 |
| high | THMM | 3 | mean dwell | 6.67 | 6.7 | 0.029 | 0.786 | 0.779 |
| high | THMM | 3 | prob | 0.15 | 0.151 | 0.0013 | 0.0171 | 0.017 |
| high | THMM | 3 | TV dwell | 0 | 0.0357 | 0.0357 | 0.0281 | 0.0453 |
| high | THSMM-G | 1 | mean curve RMSE | 0 | 0.0106 | 0.0106 | 0.00361 | 0.0112 |
| high | THSMM-G | 1 | mean dwell | 2.5 | 2.58 | 0.0802 | 0.246 | 0.256 |
| high | THSMM-G | 1 | prob | 0.4 | 0.391 | -0.00885 | 0.0386 | 0.0393 |
| high | THSMM-G | 1 | TV dwell | 0 | 0.0394 | 0.0394 | 0.0265 | 0.0473 |
| high | THSMM-G | 2 | mean curve RMSE | 0 | 0.00901 | 0.00901 | 0.00351 | 0.00965 |
| high | THSMM-G | 2 | mean dwell | 4 | 4.18 | 0.177 | 0.404 | 0.437 |
| high | THSMM-G | 2 | prob | 0.25 | 0.242 | -0.00831 | 0.0245 | 0.0257 |
| high | THSMM-G | 2 | TV dwell | 0 | 0.0357 | 0.0357 | 0.0267 | 0.0445 |
| high | THSMM-G | 3 | mean curve RMSE | 0 | 0.00688 | 0.00688 | 0.00269 | 0.00737 |
| high | THSMM-G | 3 | mean dwell | 6.67 | 6.7 | 0.029 | 0.786 | 0.779 |
| high | THSMM-G | 3 | prob | 0.15 | 0.151 | 0.0013 | 0.0171 | 0.017 |
| high | THSMM-G | 3 | TV dwell | 0 | 0.0357 | 0.0357 | 0.0281 | 0.0453 |
| high | THSMM-NB | 1 | mean curve RMSE | 0 | 0.0107 | 0.0107 | 0.00364 | 0.0113 |
| high | THSMM-NB | 1 | mean dwell | 2.5 | 2.58 | 0.0848 | 0.249 | 0.261 |
| high | THSMM-NB | 1 | prob | 0.4 | 0.432 | 0.0319 | 0.0791 | 0.0845 |
| high | THSMM-NB | 1 | size | 1 | 1.24 | 0.235 | 0.379 | 0.443 |
| high | THSMM-NB | 1 | TV dwell | 0 | 0.0613 | 0.0613 | 0.033 | 0.0695 |
| high | THSMM-NB | 2 | mean curve RMSE | 0 | 0.00903 | 0.00903 | 0.00352 | 0.00968 |
| high | THSMM-NB | 2 | mean dwell | 4 | 4.19 | 0.186 | 0.407 | 0.444 |
| high | THSMM-NB | 2 | prob | 0.25 | 0.264 | 0.0141 | 0.0539 | 0.0552 |
| high | THSMM-NB | 2 | size | 1 | 1.15 | 0.151 | 0.295 | 0.328 |
| high | THSMM-NB | 2 | TV dwell | 0 | 0.0636 | 0.0636 | 0.0343 | 0.0722 |
| high | THSMM-NB | 3 | mean curve RMSE | 0 | 0.00688 | 0.00688 | 0.00269 | 0.00738 |
| high | THSMM-NB | 3 | mean dwell | 6.67 | 6.7 | 0.0344 | 0.786 | 0.779 |
| high | THSMM-NB | 3 | prob | 0.15 | 0.166 | 0.016 | 0.035 | 0.0382 |
| high | THSMM-NB | 3 | size | 1 | 1.12 | 0.125 | 0.237 | 0.266 |
| high | THSMM-NB | 3 | TV dwell | 0 | 0.0624 | 0.0624 | 0.0263 | 0.0676 |
Table C2. Geometric truth ( replicates per cell): estimates of matched states (leave probability prob, negative binomial size and prob, mean dwell, TV distance between fitted and true dwell pmfs, RMSE of the fitted mean curve), by separation; geo() = 1 + NB(size = 1, prob = ). All dwell distributions are geometric. Methods: THMM = THMM (funHMM); THSMM-G = THSMM, geometric; THSMM-NB = THSMM, negative binomial.
An interesting takeaway is that separation of the observations drives the estimation quality. As separation increases, the total variation (TV) distance between the fitted and the true dwell pmfs falls from about 0.22 – 0.25 at low separation, to 0.10 – 0.12 at medium, to under 0.04 at high. Root means square error (RMSE) falls similarly, from 0.04 – 0.15 to below 0.011. Suggesting — at least in the case of geometric sojourn distributions — the when states overlap, a short visit to a state may get absorbed by a neighboring state, conversely long visits may unnecessarily transition out of a state; this is a known consequence for HMMs in a continuous and discrete data setting but now highlighted clearly for functional data.
Fitting the negative binomial when the truth is known to be geometric highlights how the THSMM behaves with an unnecessarily flexible dwell family. At low separation the size parameter estimates range from 15.6 to with standard deviation estimates much larger. Meaning that in some replicates the size parameter diverges towards the Poisson limit. At medium separation the size estimates begin to stabilize but remain upwardly biased (1.5 − 2.2 against a true value of 1) and at high separation they are close to the truth (1.12 − 1.24). The extra flexibility does not noticeably effect the fitted emission distributions as the mean curve RMSEs are almost identical to the geometric fits. The cost is a modest loss of precision in the dwell distribution and an unidentified size parameter when separation is low.
In conclusion, the THSMM recovers the THMM exactly when the dwell family is geometric. When the dwell family is more flexible that it needs to be, the THSMM still estimates mean dwells and state mean curves as well as the correctly specified model.
THSMM Sojourn Recovery
We now seek to answer the main question at hand, if the THSMM can recover the true sojourn distribution when we know that it is not geometric. Here we simulate nonparametric curves with low, medium, and high separation using two sojourn schemes, a shifted Poisson with shift (3, 2, 4) for states 1, 2, and 3, respectively, and negative binomial. See Table C3 for various statistics of the fitted models over 50 replications. Note, we refer to the “true model” as the one whose sojourn distributions match that of the ones used to generate the data.
| Sep. | Method | State | Parameter | True | Mean | Bias | SD | RMSE |
| True dwell distribution: negative binomial | ||||||||
| low | THMM | 1 | mean curve RMSE | 0 | 0.0551 | 0.0551 | 0.0534 | 0.0764 |
| low | THMM | 1 | mean dwell | 4 | 3.69 | -0.314 | 1.11 | 1.15 |
| low | THMM | 1 | TV dwell | 0 | 0.253 | 0.253 | 0.155 | 0.296 |
| low | THMM | 2 | mean curve RMSE | 0 | 0.0358 | 0.0358 | 0.0317 | 0.0476 |
| low | THMM | 2 | mean dwell | 6 | 5.68 | -0.324 | 1.88 | 1.89 |
| low | THMM | 2 | TV dwell | 0 | 0.345 | 0.345 | 0.15 | 0.376 |
| low | THMM | 3 | mean curve RMSE | 0 | 0.0238 | 0.0238 | 0.00783 | 0.0251 |
| low | THMM | 3 | mean dwell | 7.67 | 7.47 | -0.195 | 1.05 | 1.06 |
| low | THMM | 3 | TV dwell | 0 | 0.378 | 0.378 | 0.0431 | 0.381 |
| low | THSMM-SP | 1 | mean curve RMSE | 0 | 0.0321 | 0.0321 | 0.0182 | 0.0368 |
| low | THSMM-SP | 1 | mean dwell | 4 | 4.67 | 0.668 | 0.726 | 0.981 |
| low | THSMM-SP | 1 | TV dwell | 0 | 0.264 | 0.264 | 0.075 | 0.274 |
| low | THSMM-SP | 2 | mean curve RMSE | 0 | 0.019 | 0.019 | 0.00783 | 0.0205 |
| low | THSMM-SP | 2 | mean dwell | 6 | 6.93 | 0.926 | 0.832 | 1.24 |
| low | THSMM-SP | 2 | TV dwell | 0 | 0.262 | 0.262 | 0.0746 | 0.272 |
| low | THSMM-SP | 3 | mean curve RMSE | 0 | 0.0182 | 0.0182 | 0.0045 | 0.0188 |
| low | THSMM-SP | 3 | mean dwell | 7.67 | 8.41 | 0.743 | 0.845 | 1.12 |
| low | THSMM-SP | 3 | TV dwell | 0 | 0.194 | 0.194 | 0.066 | 0.205 |
| low | THSMM-NB | 1 | mean curve RMSE | 0 | 0.0499 | 0.0499 | 0.0527 | 0.0722 |
| low | THSMM-NB | 1 | mean dwell | 4 | 4.12 | 0.117 | 1.26 | 1.26 |
| low | THSMM-NB | 1 | prob | 0.5 | 0.646 | 0.146 | 0.174 | 0.226 |
| low | THSMM-NB | 1 | size | 3 | 9.55 | 6.55 | 11.5 | 13.1 |
| low | THSMM-NB | 1 | TV dwell | 0 | 0.228 | 0.228 | 0.167 | 0.282 |
| low | THSMM-NB | 2 | mean curve RMSE | 0 | 0.0315 | 0.0315 | 0.031 | 0.044 |
| low | THSMM-NB | 2 | mean dwell | 6 | 6.3 | 0.299 | 2.03 | 2.03 |
| low | THSMM-NB | 2 | prob | 0.5 | 0.634 | 0.134 | 0.193 | 0.233 |
| low | THSMM-NB | 2 | size | 5 | 1.19e+11 | 1.19e+11 | 5.18e+11 | 5.27e+11 |
| low | THSMM-NB | 2 | TV dwell | 0 | 0.247 | 0.247 | 0.199 | 0.316 |
| low | THSMM-NB | 3 | mean curve RMSE | 0 | 0.0195 | 0.0195 | 0.00866 | 0.0213 |
| low | THSMM-NB | 3 | mean dwell | 7.67 | 8.27 | 0.6 | 1.11 | 1.25 |
| low | THSMM-NB | 3 | prob | 0.6 | 0.677 | 0.0769 | 0.227 | 0.237 |
| low | THSMM-NB | 3 | size | 10 | 9.12e+10 | 9.12e+10 | 4.09e+11 | 4.15e+11 |
| low | THSMM-NB | 3 | TV dwell | 0 | 0.133 | 0.133 | 0.103 | 0.168 |
| low | THSMM-NP | 1 | mean curve RMSE | 0 | 0.0402 | 0.0402 | 0.0517 | 0.0651 |
| low | THSMM-NP | 1 | mean dwell | 4 | 4.7 | 0.704 | 1.03 | 1.24 |
| low | THSMM-NP | 1 | TV dwell | 0 | 0.525 | 0.525 | 0.111 | 0.536 |
| low | THSMM-NP | 2 | mean curve RMSE | 0 | 0.0229 | 0.0229 | 0.0214 | 0.0312 |
| low | THSMM-NP | 2 | mean dwell | 6 | 7.09 | 1.09 | 1.34 | 1.71 |
| low | THSMM-NP | 2 | TV dwell | 0 | 0.555 | 0.555 | 0.0889 | 0.562 |
| low | THSMM-NP | 3 | mean curve RMSE | 0 | 0.018 | 0.018 | 0.00469 | 0.0185 |
| low | THSMM-NP | 3 | mean dwell | 7.67 | 8.66 | 0.989 | 0.673 | 1.19 |
| low | THSMM-NP | 3 | TV dwell | 0 | 0.485 | 0.485 | 0.0751 | 0.49 |
| medium | THMM | 1 | mean curve RMSE | 0 | 0.0131 | 0.0131 | 0.00454 | 0.0138 |
| medium | THMM | 1 | mean dwell | 4 | 4.14 | 0.145 | 0.335 | 0.362 |
| medium | THMM | 1 | TV dwell | 0 | 0.177 | 0.177 | 0.006 | 0.177 |
| medium | THMM | 2 | mean curve RMSE | 0 | 0.011 | 0.011 | 0.00343 | 0.0115 |
| medium | THMM | 2 | mean dwell | 6 | 6.04 | 0.0357 | 0.449 | 0.446 |
| medium | THMM | 2 | TV dwell | 0 | 0.274 | 0.274 | 0.00312 | 0.274 |
| medium | THMM | 3 | mean curve RMSE | 0 | 0.0109 | 0.0109 | 0.00377 | 0.0115 |
| medium | THMM | 3 | mean dwell | 7.67 | 7.77 | 0.108 | 0.457 | 0.465 |
| medium | THMM | 3 | TV dwell | 0 | 0.369 | 0.369 | 0.0022 | 0.369 |
| medium | THSMM-SP | 1 | mean curve RMSE | 0 | 0.0138 | 0.0138 | 0.00485 | 0.0146 |
| medium | THSMM-SP | 1 | mean dwell | 4 | 4.38 | 0.378 | 0.389 | 0.539 |
| medium | THSMM-SP | 1 | TV dwell | 0 | 0.205 | 0.205 | 0.0358 | 0.208 |
| medium | THSMM-SP | 2 | mean curve RMSE | 0 | 0.0109 | 0.0109 | 0.00313 | 0.0113 |
| medium | THSMM-SP | 2 | mean dwell | 6 | 6.32 | 0.324 | 0.483 | 0.577 |
| medium | THSMM-SP | 2 | TV dwell | 0 | 0.191 | 0.191 | 0.0301 | 0.193 |
| Sep. | Method | State | Parameter | True | Mean | Bias | SD | RMSE |
| medium | THSMM-SP | 3 | mean curve RMSE | 0 | 0.0101 | 0.0101 | 0.00363 | 0.0107 |
| medium | THSMM-SP | 3 | mean dwell | 7.67 | 7.97 | 0.308 | 0.438 | 0.532 |
| medium | THSMM-SP | 3 | TV dwell | 0 | 0.144 | 0.144 | 0.0245 | 0.146 |
| medium | THSMM-NB | 1 | mean curve RMSE | 0 | 0.0128 | 0.0128 | 0.00438 | 0.0135 |
| medium | THSMM-NB | 1 | mean dwell | 4 | 4.36 | 0.36 | 0.39 | 0.528 |
| medium | THSMM-NB | 1 | prob | 0.5 | 0.622 | 0.122 | 0.117 | 0.169 |
| medium | THSMM-NB | 1 | size | 3 | 6.52 | 3.52 | 3.88 | 5.21 |
| medium | THSMM-NB | 1 | TV dwell | 0 | 0.106 | 0.106 | 0.0494 | 0.116 |
| medium | THSMM-NB | 2 | mean curve RMSE | 0 | 0.0104 | 0.0104 | 0.0031 | 0.0109 |
| medium | THSMM-NB | 2 | mean dwell | 6 | 6.33 | 0.335 | 0.463 | 0.568 |
| medium | THSMM-NB | 2 | prob | 0.5 | 0.567 | 0.0673 | 0.136 | 0.15 |
| medium | THSMM-NB | 2 | size | 5 | 9.29 | 4.29 | 8.98 | 9.88 |
| medium | THSMM-NB | 2 | TV dwell | 0 | 0.0814 | 0.0814 | 0.0478 | 0.0942 |
| medium | THSMM-NB | 3 | mean curve RMSE | 0 | 0.00996 | 0.00996 | 0.00361 | 0.0106 |
| medium | THSMM-NB | 3 | mean dwell | 7.67 | 8 | 0.338 | 0.456 | 0.564 |
| medium | THSMM-NB | 3 | prob | 0.6 | 0.662 | 0.0622 | 0.132 | 0.145 |
| medium | THSMM-NB | 3 | size | 10 | 2.99e+07 | 2.99e+07 | 2.11e+08 | 2.11e+08 |
| medium | THSMM-NB | 3 | TV dwell | 0 | 0.0742 | 0.0742 | 0.035 | 0.0819 |
| medium | THSMM-NP | 1 | mean curve RMSE | 0 | 0.013 | 0.013 | 0.00414 | 0.0137 |
| medium | THSMM-NP | 1 | mean dwell | 4 | 4.5 | 0.498 | 0.374 | 0.621 |
| medium | THSMM-NP | 1 | TV dwell | 0 | 0.277 | 0.277 | 0.0647 | 0.285 |
| medium | THSMM-NP | 2 | mean curve RMSE | 0 | 0.0106 | 0.0106 | 0.00307 | 0.011 |
| medium | THSMM-NP | 2 | mean dwell | 6 | 6.44 | 0.443 | 0.486 | 0.653 |
| medium | THSMM-NP | 2 | TV dwell | 0 | 0.296 | 0.296 | 0.0634 | 0.302 |
| medium | THSMM-NP | 3 | mean curve RMSE | 0 | 0.00986 | 0.00986 | 0.00362 | 0.0105 |
| medium | THSMM-NP | 3 | mean dwell | 7.67 | 8.08 | 0.409 | 0.48 | 0.627 |
| medium | THSMM-NP | 3 | TV dwell | 0 | 0.268 | 0.268 | 0.0602 | 0.274 |
| high | THMM | 1 | mean curve RMSE | 0 | 0.00932 | 0.00932 | 0.00431 | 0.0103 |
| high | THMM | 1 | mean dwell | 4 | 4.04 | 0.0386 | 0.338 | 0.337 |
| high | THMM | 1 | TV dwell | 0 | 0.177 | 0.177 | 0.00662 | 0.177 |
| high | THMM | 2 | mean curve RMSE | 0 | 0.00745 | 0.00745 | 0.00257 | 0.00788 |
| high | THMM | 2 | mean dwell | 6 | 6.14 | 0.135 | 0.505 | 0.518 |
| high | THMM | 2 | TV dwell | 0 | 0.275 | 0.275 | 0.00549 | 0.275 |
| high | THMM | 3 | mean curve RMSE | 0 | 0.00647 | 0.00647 | 0.00348 | 0.00733 |
| high | THMM | 3 | mean dwell | 7.67 | 7.72 | 0.0549 | 0.39 | 0.39 |
| high | THMM | 3 | TV dwell | 0 | 0.368 | 0.368 | 0.00179 | 0.368 |
| high | THSMM-SP | 1 | mean curve RMSE | 0 | 0.00952 | 0.00952 | 0.00427 | 0.0104 |
| high | THSMM-SP | 1 | mean dwell | 4 | 4.09 | 0.0915 | 0.36 | 0.368 |
| high | THSMM-SP | 1 | TV dwell | 0 | 0.183 | 0.183 | 0.0279 | 0.185 |
| high | THSMM-SP | 2 | mean curve RMSE | 0 | 0.00741 | 0.00741 | 0.00261 | 0.00785 |
| high | THSMM-SP | 2 | mean dwell | 6 | 6.19 | 0.188 | 0.522 | 0.55 |
| high | THSMM-SP | 2 | TV dwell | 0 | 0.186 | 0.186 | 0.0299 | 0.188 |
| high | THSMM-SP | 3 | mean curve RMSE | 0 | 0.00653 | 0.00653 | 0.00347 | 0.00737 |
| high | THSMM-SP | 3 | mean dwell | 7.67 | 7.73 | 0.0646 | 0.393 | 0.395 |
| high | THSMM-SP | 3 | TV dwell | 0 | 0.133 | 0.133 | 0.0122 | 0.134 |
| high | THSMM-NB | 1 | mean curve RMSE | 0 | 0.00938 | 0.00938 | 0.00429 | 0.0103 |
| high | THSMM-NB | 1 | mean dwell | 4 | 4.07 | 0.0709 | 0.346 | 0.349 |
| high | THSMM-NB | 1 | prob | 0.5 | 0.542 | 0.0418 | 0.107 | 0.113 |
| high | THSMM-NB | 1 | size | 3 | 4.11 | 1.11 | 2.4 | 2.62 |
| high | THSMM-NB | 1 | TV dwell | 0 | 0.0649 | 0.0649 | 0.0358 | 0.0739 |
| high | THSMM-NB | 2 | mean curve RMSE | 0 | 0.00742 | 0.00742 | 0.00258 | 0.00785 |
| high | THSMM-NB | 2 | mean dwell | 6 | 6.17 | 0.172 | 0.511 | 0.535 |
| high | THSMM-NB | 2 | prob | 0.5 | 0.539 | 0.0386 | 0.109 | 0.115 |
| high | THSMM-NB | 2 | size | 5 | 6.75 | 1.75 | 3.48 | 3.87 |
| high | THSMM-NB | 2 | TV dwell | 0 | 0.0677 | 0.0677 | 0.0425 | 0.0797 |
| high | THSMM-NB | 3 | mean curve RMSE | 0 | 0.0065 | 0.0065 | 0.00347 | 0.00735 |
| high | THSMM-NB | 3 | mean dwell | 7.67 | 7.73 | 0.0606 | 0.387 | 0.388 |
| high | THSMM-NB | 3 | prob | 0.6 | 0.621 | 0.0208 | 0.133 | 0.133 |
| high | THSMM-NB | 3 | size | 10 | 20.5 | 10.5 | 40.1 | 41.1 |
| high | THSMM-NB | 3 | TV dwell | 0 | 0.0585 | 0.0585 | 0.0318 | 0.0664 |
| high | THSMM-NP | 1 | mean curve RMSE | 0 | 0.0094 | 0.0094 | 0.00438 | 0.0104 |
| high | THSMM-NP | 1 | mean dwell | 4 | 4.07 | 0.0723 | 0.36 | 0.364 |
| high | THSMM-NP | 1 | TV dwell | 0 | 0.17 | 0.17 | 0.0468 | 0.176 |
| high | THSMM-NP | 2 | mean curve RMSE | 0 | 0.0074 | 0.0074 | 0.00259 | 0.00783 |
| Sep. | Method | State | Parameter | True | Mean | Bias | SD | RMSE |
| high | THSMM-NP | 2 | mean dwell | 6 | 6.18 | 0.18 | 0.521 | 0.547 |
| high | THSMM-NP | 2 | TV dwell | 0 | 0.203 | 0.203 | 0.0462 | 0.208 |
| high | THSMM-NP | 3 | mean curve RMSE | 0 | 0.00649 | 0.00649 | 0.00347 | 0.00734 |
| high | THSMM-NP | 3 | mean dwell | 7.67 | 7.72 | 0.0563 | 0.383 | 0.383 |
| high | THSMM-NP | 3 | TV dwell | 0 | 0.193 | 0.193 | 0.0402 | 0.197 |
| True dwell distribution: shifted Poisson | ||||||||
| low | THMM | 1 | mean curve RMSE | 0 | 0.0398 | 0.0398 | 0.0214 | 0.0451 |
| low | THMM | 1 | mean dwell | 4 | 3.25 | -0.748 | 0.463 | 0.877 |
| low | THMM | 1 | TV dwell | 0 | 0.622 | 0.622 | 0.0451 | 0.624 |
| low | THMM | 2 | mean curve RMSE | 0 | 0.0565 | 0.0565 | 0.024 | 0.0613 |
| low | THMM | 2 | mean dwell | 4 | 2.96 | -1.04 | 0.542 | 1.17 |
| low | THMM | 2 | TV dwell | 0 | 0.484 | 0.484 | 0.0832 | 0.491 |
| low | THMM | 3 | mean curve RMSE | 0 | 0.0507 | 0.0507 | 0.00904 | 0.0515 |
| low | THMM | 3 | mean dwell | 5 | 3.68 | -1.32 | 0.468 | 1.4 |
| low | THMM | 3 | TV dwell | 0 | 0.709 | 0.709 | 0.0251 | 0.709 |
| low | THSMM-SP | 1 | 1 | 1.07 | 0.0652 | 0.133 | 0.147 | |
| low | THSMM-SP | 1 | mean curve RMSE | 0 | 0.015 | 0.015 | 0.00485 | 0.0158 |
| low | THSMM-SP | 1 | mean dwell | 4 | 4.09 | 0.0852 | 0.152 | 0.173 |
| low | THSMM-SP | 1 | shift | 3 | 3.02 | 0.02 | 0.141 | 0.141 |
| low | THSMM-SP | 1 | TV dwell | 0 | 0.0499 | 0.0499 | 0.0547 | 0.0737 |
| low | THSMM-SP | 2 | 2 | 1.45 | -0.55 | 0.462 | 0.715 | |
| low | THSMM-SP | 2 | mean curve RMSE | 0 | 0.0188 | 0.0188 | 0.00581 | 0.0197 |
| low | THSMM-SP | 2 | mean dwell | 4 | 4.07 | 0.0701 | 0.21 | 0.22 |
| low | THSMM-SP | 2 | shift | 2 | 2.62 | 0.62 | 0.49 | 0.787 |
| low | THSMM-SP | 2 | TV dwell | 0 | 0.134 | 0.134 | 0.0766 | 0.154 |
| low | THSMM-SP | 3 | 1 | 1.06 | 0.0648 | 0.183 | 0.193 | |
| low | THSMM-SP | 3 | mean curve RMSE | 0 | 0.0165 | 0.0165 | 0.00455 | 0.0171 |
| low | THSMM-SP | 3 | mean dwell | 5 | 5.04 | 0.0448 | 0.139 | 0.145 |
| low | THSMM-SP | 3 | shift | 4 | 3.98 | -0.02 | 0.141 | 0.141 |
| low | THSMM-SP | 3 | TV dwell | 0 | 0.0441 | 0.0441 | 0.0404 | 0.0595 |
| low | THSMM-NB | 1 | mean curve RMSE | 0 | 0.0264 | 0.0264 | 0.0174 | 0.0315 |
| low | THSMM-NB | 1 | mean dwell | 4 | 2.76 | -1.24 | 0.376 | 1.29 |
| low | THSMM-NB | 1 | TV dwell | 0 | 0.517 | 0.517 | 0.085 | 0.523 |
| low | THSMM-NB | 2 | mean curve RMSE | 0 | 0.0384 | 0.0384 | 0.0194 | 0.0429 |
| low | THSMM-NB | 2 | mean dwell | 4 | 3.14 | -0.865 | 0.495 | 0.994 |
| low | THSMM-NB | 2 | TV dwell | 0 | 0.299 | 0.299 | 0.125 | 0.324 |
| low | THSMM-NB | 3 | mean curve RMSE | 0 | 0.0363 | 0.0363 | 0.011 | 0.0379 |
| low | THSMM-NB | 3 | mean dwell | 5 | 4.05 | -0.95 | 0.543 | 1.09 |
| low | THSMM-NB | 3 | TV dwell | 0 | 0.489 | 0.489 | 0.0883 | 0.497 |
| low | THSMM-NP | 1 | mean curve RMSE | 0 | 0.0147 | 0.0147 | 0.00483 | 0.0155 |
| low | THSMM-NP | 1 | mean dwell | 4 | 4.08 | 0.0787 | 0.148 | 0.166 |
| low | THSMM-NP | 1 | TV dwell | 0 | 0.224 | 0.224 | 0.107 | 0.248 |
| low | THSMM-NP | 2 | mean curve RMSE | 0 | 0.019 | 0.019 | 0.00599 | 0.0199 |
| low | THSMM-NP | 2 | mean dwell | 4 | 4.1 | 0.098 | 0.202 | 0.223 |
| low | THSMM-NP | 2 | TV dwell | 0 | 0.277 | 0.277 | 0.0954 | 0.292 |
| low | THSMM-NP | 3 | mean curve RMSE | 0 | 0.0164 | 0.0164 | 0.00475 | 0.0171 |
| low | THSMM-NP | 3 | mean dwell | 5 | 5.02 | 0.0221 | 0.19 | 0.19 |
| low | THSMM-NP | 3 | TV dwell | 0 | 0.169 | 0.169 | 0.0781 | 0.186 |
| medium | THMM | 1 | mean curve RMSE | 0 | 0.0133 | 0.0133 | 0.00456 | 0.014 |
| medium | THMM | 1 | mean dwell | 4 | 3.75 | -0.254 | 0.133 | 0.286 |
| medium | THMM | 1 | TV dwell | 0 | 0.599 | 0.599 | 0.00187 | 0.599 |
| medium | THMM | 2 | mean curve RMSE | 0 | 0.0157 | 0.0157 | 0.00532 | 0.0166 |
| medium | THMM | 2 | mean dwell | 4 | 3.75 | -0.248 | 0.186 | 0.309 |
| medium | THMM | 2 | TV dwell | 0 | 0.43 | 0.43 | 0.00284 | 0.43 |
| medium | THMM | 3 | mean curve RMSE | 0 | 0.0153 | 0.0153 | 0.00434 | 0.0159 |
| medium | THMM | 3 | mean dwell | 5 | 4.73 | -0.274 | 0.147 | 0.31 |
| medium | THMM | 3 | TV dwell | 0 | 0.681 | 0.681 | 0.00127 | 0.681 |
| medium | THSMM-SP | 1 | 1 | 2.05 | 1.05 | 0.192 | 1.06 | |
| medium | THSMM-SP | 1 | mean curve RMSE | 0 | 0.0101 | 0.0101 | 0.00381 | 0.0107 |
| medium | THSMM-SP | 1 | mean dwell | 4 | 4.15 | 0.147 | 0.235 | 0.275 |
| medium | THSMM-SP | 1 | shift | 3 | 2.1 | -0.9 | 0.303 | 0.949 |
| medium | THSMM-SP | 1 | TV dwell | 0 | 0.213 | 0.213 | 0.0231 | 0.215 |
| medium | THSMM-SP | 2 | 2 | 2.07 | 0.0665 | 0.254 | 0.26 | |
| Sep. | Method | State | Parameter | True | Mean | Bias | SD | RMSE |
| medium | THSMM-SP | 2 | mean curve RMSE | 0 | 0.0113 | 0.0113 | 0.00477 | 0.0123 |
| medium | THSMM-SP | 2 | mean dwell | 4 | 4.05 | 0.0465 | 0.173 | 0.178 |
| medium | THSMM-SP | 2 | shift | 2 | 1.98 | -0.02 | 0.141 | 0.141 |
| medium | THSMM-SP | 2 | TV dwell | 0 | 0.0409 | 0.0409 | 0.031 | 0.0511 |
| medium | THSMM-SP | 3 | 1 | 2.45 | 1.45 | 0.337 | 1.48 | |
| medium | THSMM-SP | 3 | mean curve RMSE | 0 | 0.0102 | 0.0102 | 0.00346 | 0.0108 |
| medium | THSMM-SP | 3 | mean dwell | 5 | 5.33 | 0.327 | 0.266 | 0.42 |
| medium | THSMM-SP | 3 | shift | 4 | 2.88 | -1.12 | 0.328 | 1.17 |
| medium | THSMM-SP | 3 | TV dwell | 0 | 0.26 | 0.26 | 0.0407 | 0.263 |
| medium | THSMM-NB | 1 | mean curve RMSE | 0 | 0.0113 | 0.0113 | 0.00416 | 0.0121 |
| medium | THSMM-NB | 1 | mean dwell | 4 | 3.2 | -0.801 | 0.211 | 0.828 |
| medium | THSMM-NB | 1 | TV dwell | 0 | 0.43 | 0.43 | 0.0365 | 0.431 |
| medium | THSMM-NB | 2 | mean curve RMSE | 0 | 0.0134 | 0.0134 | 0.00507 | 0.0143 |
| medium | THSMM-NB | 2 | mean dwell | 4 | 3.2 | -0.801 | 0.327 | 0.864 |
| medium | THSMM-NB | 2 | TV dwell | 0 | 0.274 | 0.274 | 0.0619 | 0.281 |
| medium | THSMM-NB | 3 | mean curve RMSE | 0 | 0.0122 | 0.0122 | 0.00402 | 0.0128 |
| medium | THSMM-NB | 3 | mean dwell | 5 | 4.1 | -0.9 | 0.359 | 0.967 |
| medium | THSMM-NB | 3 | TV dwell | 0 | 0.474 | 0.474 | 0.0545 | 0.477 |
| medium | THSMM-NP | 1 | mean curve RMSE | 0 | 0.00946 | 0.00946 | 0.00361 | 0.0101 |
| medium | THSMM-NP | 1 | mean dwell | 4 | 3.99 | -0.0102 | 0.121 | 0.12 |
| medium | THSMM-NP | 1 | TV dwell | 0 | 0.12 | 0.12 | 0.0519 | 0.131 |
| medium | THSMM-NP | 2 | mean curve RMSE | 0 | 0.0115 | 0.0115 | 0.00442 | 0.0123 |
| medium | THSMM-NP | 2 | mean dwell | 4 | 4.05 | 0.0508 | 0.183 | 0.188 |
| medium | THSMM-NP | 2 | TV dwell | 0 | 0.137 | 0.137 | 0.0497 | 0.145 |
| medium | THSMM-NP | 3 | mean curve RMSE | 0 | 0.00912 | 0.00912 | 0.00351 | 0.00975 |
| medium | THSMM-NP | 3 | mean dwell | 5 | 4.97 | -0.0316 | 0.12 | 0.123 |
| medium | THSMM-NP | 3 | TV dwell | 0 | 0.102 | 0.102 | 0.0409 | 0.11 |
| high | THMM | 1 | mean curve RMSE | 0 | 0.00897 | 0.00897 | 0.0036 | 0.00965 |
| high | THMM | 1 | mean dwell | 4 | 4 | 0.001 | 0.101 | 0.1 |
| high | THMM | 1 | TV dwell | 0 | 0.597 | 0.597 | 0.000488 | 0.597 |
| high | THMM | 2 | mean curve RMSE | 0 | 0.00879 | 0.00879 | 0.00361 | 0.00949 |
| high | THMM | 2 | mean dwell | 4 | 3.95 | -0.0543 | 0.152 | 0.16 |
| high | THMM | 2 | TV dwell | 0 | 0.428 | 0.428 | 0.00121 | 0.428 |
| high | THMM | 3 | mean curve RMSE | 0 | 0.00758 | 0.00758 | 0.00326 | 0.00824 |
| high | THMM | 3 | mean dwell | 5 | 4.98 | -0.0168 | 0.106 | 0.107 |
| high | THMM | 3 | TV dwell | 0 | 0.679 | 0.679 | 0.000393 | 0.679 |
| high | THSMM-SP | 1 | 1 | 2.84 | 1.84 | 0.186 | 1.85 | |
| high | THSMM-SP | 1 | mean curve RMSE | 0 | 0.00899 | 0.00899 | 0.00359 | 0.00967 |
| high | THSMM-SP | 1 | mean dwell | 4 | 4.44 | 0.442 | 0.367 | 0.572 |
| high | THSMM-SP | 1 | shift | 3 | 1.6 | -1.4 | 0.495 | 1.48 |
| high | THSMM-SP | 1 | TV dwell | 0 | 0.31 | 0.31 | 0.0205 | 0.31 |
| high | THSMM-SP | 2 | 2 | 2.96 | 0.96 | 0.153 | 0.972 | |
| high | THSMM-SP | 2 | mean curve RMSE | 0 | 0.00872 | 0.00872 | 0.00357 | 0.00941 |
| high | THSMM-SP | 2 | mean dwell | 4 | 3.96 | -0.0396 | 0.153 | 0.157 |
| high | THSMM-SP | 2 | shift | 2 | 1 | -1 | 0 | 1 |
| high | THSMM-SP | 2 | TV dwell | 0 | 0.109 | 0.109 | 0.00695 | 0.109 |
| high | THSMM-SP | 3 | 1 | 3.76 | 2.76 | 0.193 | 2.76 | |
| high | THSMM-SP | 3 | mean curve RMSE | 0 | 0.00754 | 0.00754 | 0.00325 | 0.0082 |
| high | THSMM-SP | 3 | mean dwell | 5 | 5.58 | 0.576 | 0.307 | 0.651 |
| high | THSMM-SP | 3 | shift | 4 | 1.82 | -2.18 | 0.388 | 2.21 |
| high | THSMM-SP | 3 | TV dwell | 0 | 0.361 | 0.361 | 0.0186 | 0.361 |
| high | THSMM-NB | 1 | mean curve RMSE | 0 | 0.00899 | 0.00899 | 0.00359 | 0.00967 |
| high | THSMM-NB | 1 | mean dwell | 4 | 3.91 | -0.0899 | 0.0995 | 0.133 |
| high | THSMM-NB | 1 | TV dwell | 0 | 0.357 | 0.357 | 0.00323 | 0.357 |
| high | THSMM-NB | 2 | mean curve RMSE | 0 | 0.00874 | 0.00874 | 0.00357 | 0.00943 |
| high | THSMM-NB | 2 | mean dwell | 4 | 3.89 | -0.11 | 0.143 | 0.179 |
| high | THSMM-NB | 2 | TV dwell | 0 | 0.164 | 0.164 | 0.00181 | 0.164 |
| high | THSMM-NB | 3 | mean curve RMSE | 0 | 0.00755 | 0.00755 | 0.00325 | 0.0082 |
| high | THSMM-NB | 3 | mean dwell | 5 | 4.76 | -0.241 | 0.0938 | 0.258 |
| high | THSMM-NB | 3 | TV dwell | 0 | 0.408 | 0.408 | 0.00389 | 0.408 |
| high | THSMM-NP | 1 | mean curve RMSE | 0 | 0.00901 | 0.00901 | 0.00356 | 0.00967 |
| high | THSMM-NP | 1 | mean dwell | 4 | 4.01 | 0.0144 | 0.101 | 0.101 |
| high | THSMM-NP | 1 | TV dwell | 0 | 0.0835 | 0.0835 | 0.0318 | 0.0892 |
| high | THSMM-NP | 2 | mean curve RMSE | 0 | 0.00876 | 0.00876 | 0.00357 | 0.00944 |
| Sep. | Method | State | Parameter | True | Mean | Bias | SD | RMSE |
| high | THSMM-NP | 2 | mean dwell | 4 | 3.97 | -0.0332 | 0.154 | 0.156 |
| high | THSMM-NP | 2 | TV dwell | 0 | 0.097 | 0.097 | 0.0317 | 0.102 |
| high | THSMM-NP | 3 | mean curve RMSE | 0 | 0.00752 | 0.00752 | 0.00326 | 0.00819 |
| high | THSMM-NP | 3 | mean dwell | 5 | 4.99 | -0.0123 | 0.105 | 0.105 |
| high | THSMM-NP | 3 | TV dwell | 0 | 0.0805 | 0.0805 | 0.0299 | 0.0858 |
Table C3. Non-geometric truths ( replicates per cell): dwell and mean-curve estimates of matched states, by separation. Methods: THMM = THMM (funHMM); THSMM-SP = THSMM, shifted Poisson; THSMM-NB = THSMM, negative binomial; THSMM-NP = THSMM, nonparametric.
The low separation setting with shifted Poisson dwell times shows most clearly how much the dwell specifications matter when the states are hard to tell apart, see Figure 4. All three true distributions put no mass below a minimum sojourn length of . As expected the THMM cannot represent this minimum and underestimates every mean dwell time giving (3.25, 2.96, 3.68) against the true values of (4, 4, 5). The negative binomial family also has poor performance with its mean dwell times having a downwards bias, due to the constraint of needing to put some mass in the first four dwell times. The non-parametric sojourn recovers mean dwell very accurately however at the cost of having a much higher TV distance, which is expected when estimating an unstructured pmf. Finally, the shifted poisson gives the most accurate fit, it recovers the shift for each state within 0.02, and estimates every mean dwell to within 0.09.
Figure 4. Fitted sojourn distributions per state for THMM and various THSMMs on nonparametric curves with shifted Poisson sojourn distributions. In pink the estimated 10 – 90% band over 50 replications of the fitted Poisson sojourns.
In the low separation setting when the true dwell times are negative binomial, there is no definitive winner between models. The true distributions are overdispersed and lie much closer to the geometric family than the shifted Poisson, leaving more “wiggle room” for various sojourn distributions to fit, see Figure 3. The shifted Poisson THSMM trades bias for stability as its shape is completely dictated by a single parameter. The cost comes at an upwards bias towards mean dwell times where they were overestimated by 0.68 – 0.93. However, this added stability allows for it to produce the most accurate emission distributions from among the models. By assigning zero probability to sojourns shorter than , it suppresses spurious short state visits in the forward–backward recursions. The posterior state weights used in the emission update are therefore less contaminated by observations from overlapping states. Nonparametric sojourn distributions struggle in this setting as overlapping states plague the increased flexibility of the distribution with numerical instability. In Figure 5, the nonparametric sojourns are quite rough and have erratic behaviors. Finally, the negative binomial distribution recovers the shape of the sojourn the best. However, individual parameters are poorly identified. In some cases the size degenerated to the Poisson limit and the estimates are biased upwards to compensate. This can be seen in the 10–90% bands in the plot, with the large spike indicates a misspecified fit.

Figure 5. Fitted sojourn distributions per state for THMM and various THSMMs on nonparametric curves with negative binomial sojourn distributions. In orange the estimated 10 – 90% band over 50 replications of the fitted negative binomial sojourn.
Many more results can be found in the accompanying repository. First, the negative binomial cannot recover the under-dispersion that the shifted Poisson can tackle; conversely, the shifted Poisson is typically upwardly biased in mean state duration estimates. Second, the nonparametric sojourn distribution estimates become more stable as the separation of the data increases, see Table C3. This suggests that more data could also remedy stability. Finally, the importance of running many repetitions to achieve a model with adequately stable estimates is necessary when data separation is low.
In conclusion, The THMM’s geometric assumption creates a dwell error of known size that more data cannot remove. Any non-geometric THSMM reduces it, and a correctly specified family nearly eliminates it at moderate separation. The nonparametric THSMM is a useful default that makes no assumption about form, provided the states are reasonably well separated. When they are not, a parametric family with the right dispersion direction is the better choice. When the states are hard to distinguish, the dwell model also improves the recovered state mean curves.
THSMM Comparative Performance
We investigate Viterbi performance between THMM and THSMM models. This is of quite some importance as it can be argued that the actual usefulness of either of these models (or any latent state space model) is to decode the hidden state sequence of observations. As before we simulate nonparametric curves at low, medium, and high separation, under shifted Poisson and negative binomial sojourn distributions. Additionally to form a more comprehensive study we further simulate Brownian motion (BM), Ornstein-Uhlenbeck (OU) Process, and fractional Brownian Motion (fBM), under shifted Poisson, negative binomial, Weibull and a mixed family setting where each of the preceding is the sojourn for an individual state.
See Table 1 for ARIs of the nonparametric curve setting used in the previous subsections. First, the most meaningful gains to ARI occurred in the low separation setting. This is where the semi-Markov structure is most useful. When states overlap, a THSMM’s probability of leaving a state depends on how long the process has already spent there, so an ambiguous observation early in a sojourn is attributed to the current state rather than treated as evidence of a transition. The mechanism is clearest through the dwell hazard
| Dwell truth | Sep. | THMM (funHMM) | THSMM-G | THSMM-true |
| Negative binomial | low | 0.665 (0.131) | 0.665 (0.131) | 0.710 (0.137) |
| medium | 0.950 (0.017) | 0.950 (0.017) | 0.948 (0.018) | |
| high | 0.997 (0.003) | 0.997 (0.003) | 0.995 (0.003) | |
| Shifted Poisson | low | 0.519 (0.091) | 0.519 (0.091) | 0.864 (0.031) |
| medium | 0.950 (0.015) | 0.950 (0.015) | 0.970 (0.010) | |
| high | 0.998 (0.002) | 0.998 (0.002) | 0.999 (0.002) |
Table 1. Viterbi ARI against the true states (mean (sd) over 50 replicates) by dwell truth and separation. THSMM-G is the THMM fitted by the THSMM code (geometric dwell); THSMM-true uses the true dwell family.
which gives the probability of leaving state after time steps, given that it has not left before then. In the expanded-state representation, is precisely the exit probability from the -th substate of state ’s aggregate. At each time step, the forward–backward recursions weigh this prior exit probability against the emission evidence: the posterior log-odds of a transition combine with the log-likelihood ratio of the observation under the competing states. When states overlap, that likelihood ratio is close to zero, so the dwell term dominates the decision. As observations become more well separated the semi-Markov dynamics play less of a roll and emission densities take over the state assignment from the Viterbi algorithm. This is not a detriment to the THSMM. Classically best model fitting practice suggest to fit a model with the fewest number of parameters while not sacrificing accuracy. Therefore, in a setting where the data is well separated the user should take an Occam’s razor approach to model fitting (which is historically the most commonly accepted approach) and choose a THMM instead of a THSMM.
To extend the study and confirm that gains are not made solely on the emission emission distributions, we repeat the comparison with BM, OU, and fBM, emission distributions as well. See Figure C1, Figure C2, Figure C3, and Figure C4 for examples of plotted emission distributions with various sojourn distributions.
Figure C1. Simulated Brownian motion with drift form a three state semi-Markov process where sojourn distributions are shifted Poisson.
Figure C2. Simulated Brownian motion with drift form a three state semi-Markov process where sojourn distributions are a mixture of families.
Figure C3. Simulated OU from a three state semi-Markov process where sojourn distributions are negative binomial.
Figure C4. Simulated Fractional BM with drift from a three state semi-Markov process where sojourn distributions are Weibull.
The oracle choice for the sojourn distribution is optimal, which is seen in all twelve process–scenario combinations in Table 2. Nevertheless, the nonparametric THSMM keeps most of this advantage without knowing the dwell family. Its gains are 0.10–0.14 for shifted Poisson, 0.03–0.05 for Weibull and 0.02–0.06 for mixed families, typically 0.01–0.03 below the true family. The exception is the peaked negative binomial. There the nonparametric THSMM is no better than the THMM: its mean differences range from −0.018 to 0.007, and it is better in only 34–52% of replicates. This matches § 2, where the nonparametric model struggled to estimate diffuse negative binomial dwell distributions. Overall, a correctly specified parametric family gives the best decoding. When the family is unknown, the nonparametric THSMM is a safe default that never decodes meaningfully worse than the THMM and is often substantially better.
| Process | Scenario | THMM | THSMM-G | THSMM-NP | THSMM-true |
| BM | Shifted Poisson | 0.640 (0.059) | 0.647 (0.055) | 0.760 (0.055) | 0.789 (0.048) |
| Peaked NB | 0.681 (0.054) | 0.688 (0.058) | 0.669 (0.054) | 0.709 (0.064) | |
| Weibull | 0.678 (0.059) | 0.685 (0.058) | 0.718 (0.049) | 0.724 (0.050) | |
| Mixed families | 0.678 (0.047) | 0.677 (0.050) | 0.718 (0.052) | 0.739 (0.052) | |
| OU | Shifted Poisson | 0.657 (0.046) | 0.661 (0.052) | 0.758 (0.051) | 0.786 (0.051) |
| Peaked NB | 0.677 (0.066) | 0.687 (0.052) | 0.683 (0.054) | 0.723 (0.041) | |
| Weibull | 0.679 (0.043) | 0.681 (0.044) | 0.717 (0.048) | 0.723 (0.048) | |
| Mixed families | 0.655 (0.078) | 0.654 (0.092) | 0.711 (0.063) | 0.729 (0.073) | |
| fBM | Shifted Poisson | 0.631 (0.064) | 0.632 (0.059) | 0.767 (0.051) | 0.793 (0.047) |
| Peaked NB | 0.674 (0.052) | 0.673 (0.058) | 0.676 (0.057) | 0.703 (0.068) | |
| Weibull | 0.671 (0.059) | 0.677 (0.057) | 0.721 (0.044) | 0.727 (0.047) | |
| Mixed families | 0.672 (0.066) | 0.676 (0.065) | 0.698 (0.072) | 0.748 (0.060) |
Table 2. Viterbi ARI under non-geometric dwell times, BM / OU / fBM emissions at low separation (mean (sd) over 50 replicates). THSMM-G is the THMM fitted by the THSMM code (geometric dwell); THSMM-NP is nonparametric; THSMM-true uses the true dwell family. Peaked NB = peaked negative binomial; Weibull has increasing hazard. Failed fits are excluded.
In conclusion, the advantage of modeling the sojourn distribution comes from the dwell structure, not from any particular emission process. And we can confirm that the THSMM even if misspecified will give no worse decoding accuracy than the THMM when the sojourn distributions are not geometric.
Summary
Taken together, the simulations support three conclusions. First, the THSMM is a strict generalisation of the THMM. With geometric dwell times, it reproduces the THMM’s parameter estimates and Viterbi paths exactly, and fitting a more flexible family than needed costs only a modest loss of precision in the dwell distribution, with no effect on the mean dwells or state mean curves. Second, the THMM’s geometric assumption causes a dwell error that more data cannot remove. Any non-geometric THSMM reduces this error, and a correctly specified family nearly eliminates it at moderate separation. Misspecified parametric families still improve on the THMM, especially when their dispersion is in the right direction. The nonparametric THSMM is a robust default when the family is unknown, but it needs reasonable separation to estimate diffuse distributions. Third, these gains carry over to state decoding. The size of the gain depends on how far the dwell distribution is from geometric and on how hard the states are to distinguish. Under the shifted Poisson truth at low separation, the mean ARI rises from 0.52 to 0.86. Under Brownian motion, Ornstein–Uhlenbeck and fractional Brownian motion emissions, the true-family THSMM decodes significantly better than the THMM in every scenario. The common mechanism is the dwell hazard. When emissions overlap, a dwell distribution with an increasing hazard suppresses the spurious short visits that the geometric model favours a priori. This improves both segmentation and emission estimation, and the advantage fades only once the emissions alone separate the states.
Pediatric Obstructive Sleep Apnea Data
The gold standard for diagnosis of obstructive sleep apnea in children is by overnight polysomnography in a hospital or sleep clinic. Polysomnography provides multichannel time series including an electroencephalogram (EEG), electrocardiography (ECG), electrooculography (EOG), and electromyography (EMG). Even for a single patient, this data is vast and should eventually be considered jointly to label sleep states and identify sleep disorders. For simplicity we choose one channel of EEG from one patient labeled as CF076 to be used as a proof of concept. This patient was selected from a group of seventy four pediatric patients with potential obstructive sleep apnea in a clinical study, Pro00057638, approved by University of Alberta. An in-depth analysis of this data can be found in [36]. The sampling rate for EEG is 512 samples per second. Each signal was split into a sequence of epochs, i.e. 30 second intervals. These signals were transformed into power spectral densities (PSD) using Welch’s method for each epoch. The reason for dividing time series into 30 second intervals is to group them with respect to five sleep stages: wake, rapid eye-movement (REM), and non-rapid eye-movement (NREM). The NREM category is further divided into three states: NREM1, NREM2, NREM3. The sleep stages are labelled per epoch by a sleep technician. For every sleep stage not labelled as wake, the patient is considered to be asleep. The spectral densities for each epoch may then be used to identify possible underlying states such as the sleep stages. There were 948 epochs in patient CF050.
Markov models and HMMs have a long history of being applied to the modelling of sleep states [37, 38, 39]. The work of [40] considered an HMM with Gaussian observations for EEG analysis. This was followed by similar analyses in [41, 42]. More recent work includes [43, 44, 45]. Typically, these approaches are based on various discretization and feature selection methods whose output is then fed into the classic HMM. The novelty of the THMM [15] is that it takes the entire power spectral density curve into account and hence obviates the need for such feature selection steps. However it still restricts modelling to the geometric sojourn distribution whereas the recent work of [46] suggest that the negative binomial sojourn may be more appropriate for modeling sleep cycles.
We begin by fitting various THSMMs and THMMs, focousing on THSMMs with Shifted Poisson sojourn distributions and nonparametric functional emission distributions. We choose Shifted Poisson for two reason; first, both models have the same number of free parameters thus they only vary in the shape of the sojourn distribution; second, we found that throughout the exploratory process the Shifted Poisson has the most stable fitted parameters likely due to the fact that the distribution is parameterized only by the mean.
To vary how strongly the emissions drive the posterior relative to the dwell model, we scale the emission variance by a multiplier , taking . Smaller flattens the emission likelihood allowing for a larger contribution of the sojourn distributions2. Each model was fitted from 51 starts: a k-means baseline plus 50 random perturbations of it. We kept the fit with the highest likelihood and obtained a decoded state sequence with the Viterbi algorithm. We then matched the fitted states to the scored stages and compute accuracy and the adjusted Randi Index (ARI).
Both models recover sleep structure well beyond chance. Permuting the scored labels gives ARI (99th percentile 0.015). Every selected fit reaches ARI (moderate to weak) (see Table 3).
| Model | Accuracy | Bal. acc. | ARI | Sojourns (scored: 71) | Epochs differing | |
| 1.0 | THMM | 0.532 | 0.487 | 0.325 | 101 | – |
| 1.0 | THSMM | 0.528 | 0.478 | 0.323 | 95 | 8% |
| 0.3 | THMM | 0.545 | 0.503 | 0.331 | 49 | – |
| 0.3 | THSMM | 0.614 | 0.510 | 0.431 | 66 | 60% |
| 0.1 | THMM | 0.548 | 0.490 | 0.397 | 24 | – |
| 0.1 | THSMM | 0.609 | 0.504 | 0.441 | 55 | 52% |
Table 3. Viterbi agreement with the scored states for the highest likelihood fit at each .
We see that the dwell time modeling matters most when emission are not decisive. At , the emission dominates. The two Viterbi paths differ on only 8% of epochs, and the THSMM and THMM are indistinguishable. As decreases, the dwell model shapes the decoded path more. The THSMM then improves accuracy by 6–7 points and ARI by 0.04–0.10. The THMM responds to weaker emissions by collapsing into very few long runs and its fitted mean dwell for NREM1 grows from 15 to 48 epochs against a scored 2.7. Notice the 49 sojourns at and 24 at (see Table 3). The THSMM keeps a sojourn count close to the scored one (66 at ). It also fits short NREM1 sojourns (6.7 epochs) together with long NREM2 and NREM3 sojourns (20.9 and 35.7). A single geometric rate per state cannot produce that contrast. See Figure 6 for plots of the fitted sojourn distributions, were we see that the Poisson sojourn is adapting much better to dwells of longer lengths than that of the geometric. See D for plotted Viterbi state sequences for the fitted models when .

Figure 6. Fitted emission distributions for the THSMM when .
Both models identify NREM3 well (recall 0.73–0.96). Neither recovers NREM1, which is short, rare (5% of epochs) and has a PSD closely resembling the states around it (recall ). Most of the THSMM’s improvement comes from NREM2, whose recall rises from about 0.41 to 0.68–0.72 at . The main persistent error is between Awake and REM, whose smoothed PSDs are similar and is the major cause of low ARI scores for both models. Whichever of the two the models label correctly, most epochs of the other are assigned to it: REM is mostly labelled Awake by the THSMM at , and Awake is mostly labelled REM in most of the other fits. A single EEG channel is unlikely to separate these stages without EOG or EMG. For plots of the fitted emission distributions see Figure 7 and see Figure 8 for fitted emissions overlaid on the data (where observations are coloured by decoded states from the specified model).

Figure 7. Fitted emission distributions for the THMM and THSMM when .

Figure 8. Observations labelled by score and predicted state from Viterbi for the THMM and THSMM when .
In summary, replacing the sojourn dynamic gives no benefit when the functional emissions alone determine the path. When we temper the emission distributions, the sojourn distributions have a meaningful impact on likelihood and yield a better calibrated model with higher agreement with the technician scoring. The moderate ARI scores can likely be improved by implementing multiple signals into the emission distributions and is something to consider in future work.
Conclusion
We develop a new model framework THSMM, by incorporating a semi-Markov component to the already existing THMM. By embedding the semi-Markov chain into the THMM transition probability matrix, we obtain Markov chain dynamics whose state durations can follow arbitrary distributions, approximating any known duration family up to length . Furthermore, the implementation of THSMM is greatly simplified due to this framework as we have immediate access to the standard (T)HMM toolkit such as the Viterbi algorithm; this can be extended to further results such as THSMMs with covariates, in the state dependent process or the latent process, something we look forward to implementing in the future. Our EM framework yields closed-form updates for the functional distribution parameters during model fitting, a problem that is ill-posed for direct numerical optimization.
As demonstrated in the synthetic data setting the added flexibility yields a tangible improvement to decoded state accuracy; in particular when emission distributions have a strong overlap, the semi-Markov dynamics produce more stable Viterbi sequences. When applied to EEG data from patient CF076, a particularly challenging case to model, the THSMM again improves stability, achieving higher accuracy and ARI than its THMM counterpart.
The THSMM thus extends the THMM to arbitrary duration distributions at little additional computational cost, with clear gains in settings where state emissions overlap, and dwell times are not geometric.
Funding, Conflicts of interests, and AI Usage
The authors would like to thank the Natural Sciences and Engineering Research Council of Canada (NSERC) and the McIntyre Memorial fund from the School of Dentistry at the University of Alberta for their grant funding in support of this research. We declare that their are no conflicts of interest to report in regard to this research project. The ideas and work contained in this paper came solely from the authors. The original research code was written by the authors in R and subsequently translated into C and optimized by Claude Opus. This LLM written C code was carefully checked for accuracy and compared to the original R code by the authors.
Derivations for EM Equations
In the following we note that the time is excluded. Although there has been much work dedicated to right censoring of semi-Markov processes ([47]). For ease of notation we denote as the likelihood.
Derivation of : We want to find
but we do not have access to so we use the forward and backwards probabilities.
Summing over all time then gives
Derivation of : Begin with:
We do not care which we jump to only that we left state , therefore we sum over , finally summing over time and dividing by yields the expectation:
Derivation of : It is easiest to immediately start by taking the expected value of :
Derivation of : Corresponds to the regular EM update for a HMM except not we only focus on non zero entries using forward and backwards probabilities. Yielding:
Throughout all the derivations above the forward and backwards passes produce , , , and , which are used to create , , and .
EM Pseudo Code
Algorithm 1 The THSMM EM algorithm
Require: Observations ; number of states ; for each state a dwell-time family , aggregate size and emission functional ; tolerance .
Initialize , (with ), , for .
Substates are pairs with , and .
repeat iteration
Model quantities
for hazards, Eq. (2)
, , offset emissions
Forward pass
; ;
for do
exit flux, Eq. (13)
, for enter
for all remain in
; ;
end for
Backward pass for all
for do
value of entering
exit value, Eq. (14)
end for
Expected sufficient statistics
, posterior occupancy
expected visits
expected departures
expected jumps
Maximization
; for fixed when
for do
if is nonparametric then
, no tail:
else if is geometric then
else
Algorithm 2
end if
end for
until and
return
| Emission | Functional and update |
| Brownian motion with drift; fractional BM (Hurst ) | <br> |
| Ornstein–Uhlenbeck, mean | <br><br> |
| Nonparametric mean | <br> |
| Gaussian on | <br><br> |
Table B1. Weighted M-step updates in Algorithm 1, where . Each entry gives up to terms free of , then the update.
Algorithm 2 Dwell-time M-step for a parametric family (Fisher scoring)
function DWELLSCORING(, , )
unconstrained transform of ▷ e.g. ; shifts held fixed
Let
for do ▷ a few steps per EM iteration suffice
, , for
▷ score
▷ expected information
;
while do
▷ step-halving keeps EM monotone
end while
end for
return
end function
Curves are observed on a grid , with increments . Brownian motion: , , elapsed time , with cell averages , and ; for , and . Ornstein–Uhlenbeck (left-point sums): , , and ; are their -weighted sums and . Nonparametric: the update is exact for the , and norms (unique up to the null space of the latter two seminorms) and a heuristic for the sup norm.
Simulation Details
Pediatric Obstructive Sleep Apnea Details

Figure D5. Decoded state sequence from Viterbi algorithm for the THMM and THSMM when .

Figure D6. Decoded state sequence from Viterbi algorithm for the THMM and THSMM when .

Figure D7. Decoded state sequence from Viterbi algorithm for the THMM and THSMM when .
References
- [1]Baum, L.E., Petrie, T.: Statistical inference for probabilistic functions of finite state Markov chains. The annals of mathematical statistics 37(6), 1554–1563 (1966)DOI
- [2]Baum, L.E., Petrie, T., Soules, G., Weiss, N.: A maximization technique occurring in the statistical analysis of probabilistic functions of Markov chains. The annals of mathematical statistics 41(1), 164–171 (1970)DOI
- [3]Dempster, A.P., Laird, N.M., Rubin, D.B.: Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal Statistical Society: Series B (Methodological) 39(1), 1–22 (1977)DOI
- [4]Wu, C.J.: On the convergence properties of the em algorithm. The Annals of statistics, 95–103 (1983)DOI
- [5]Ferguson, J.: Hidden markov analysis: an introduction. Proceedings of the Symposium on the Application of Hidden Markov Models to Text and Speech (1980)
- [6]Rabiner, L.R.: A tutorial on Hidden Markov Models and selected applications in speech recognition. Proceedings of the IEEE 77(2), 257–286 (1989)
- [7]Juang, B.H., Rabiner, L.R.: Hidden Markov models for speech recognition. Technometrics 33(3), 251–272 (1991)DOI
- [8]Liporace, L.A.: Maximum likelihood estimation for multivariate observations of Markov sources. IEEE Transactions on Information Theory 28(5), 729–734 (1982)DOI
- [9]Chatzis, S.P.: Hidden markov models with nonlinearly contoured state densities. IEEE transactions on pattern analysis and machine intelligence 32(12), 2297–2304 (2010)DOI
- [10]Altman, R.M.: Mixed hidden markov models: an extension of the hidden markov [11] Alexandrovich, G., Holzmann, H., Leister, A.: Nonparametric identification and maximum likelihood estimation for hidden markov models. Biometrika 103, 423–434 (2016) https://doi.org/10.1093/biomet/asw001
- [12]Gassiat, E., Rousseau, J.: Nonparametric finite translation hidden markov models and extensions. Bernoulli 22, 193–212 (2016) https://doi.org/10.3150/14-BEJ631
- [13]Martino, A., Guatteri, G., Paganoni, A.M.: Hidden markov models for multivariate functional data. Statistics & Probability Letters 167, 108917 (2020)DOI
- [14]Sidrow, E., Heckman, N., Fortune, S.M., Trites, A.W., Murphy, I., Auger-Méthé, M.: Modelling multi-scale, state-switching functional data with hidden markov models. Canadian Journal of Statistics (2021)DOI
- [15]Kashlak, A.B., Loliencar, P., Heo, G.: Topological hidden Markov models. Journal of Machine Learning Research 24(340), 1–49 (2023)arxiv.org/abs/2205.13608
- [16]Onsager, L., Machlup, S.: Fluctuations and irreversible processes. Phys. Rev. 91, 1505–1512 (1953) https://doi.org/10.1103/PhysRev.91.1505
- [17]Bogachev, V.I.: Gaussian Measures vol. 62. American Mathematical Society Providence, ??? (1998)
- [18]Langrock, R., Zucchini, W.: Hidden markov models with arbitrary state dwell-time distributions. Computational Statistics & Data Analysis 55(1), 715–724 (2011) https://doi.org/10.1016/j.csda.2010.06.015
- [19]Levinson, S.E.: Continuously variable duration hidden markov models for automatic speech recognition. Computer Speech & Language 1(1), 29–45 (1986) https://doi.org/10.1016/S0885-2308(86)80009-2
- [20]Yu, S.-Z.: Hidden semi-markov models. Artificial Intelligence 174(2), 215–243 (2010) https://doi.org/10.1016/j.artint.2009.11.011 . Special Review Issue
- [21]Sansom, J., Thomson, P.: Fitting hidden semi-markov models to breakpoint rainfall data. Journal of Applied Probability 38(A), 142–157 (2001) https://doi.org/10.1239/jap/1085496598
- [22]Bulla, J., Bulla, I.: Stylized facts of financial time series and hidden semi-markov models. Computational Statistics & Data Analysis 51, 2192–2209 (2006) https://doi.org/10.1016/j.csda.2006.07.021
- [23]Langrock, R., King, R., Matthiopoulos, J., Thomas, L., Fortin, D., Morales, J.M.: Flexible and practical modeling of animal telemetry data: hidden Markov models and extensions. Ecology 93(11), 2336–2342 (2012) https://doi.org/10.1890/11-2241.1
- [24]Yu, S.-Z.: Hidden Semi-Markov Models: Theory, Algorithms and Applications. Elsevier Academic Press, London, UK (2015)
- [25]Guédon, Y.: Estimating hidden semi-Markov chains from discrete sequences. Journal of Computational and Graphical Statistics 12(3), 604–639 (2003) https://doi.org/10.1198/1061860032030
- [26]Yu, S.-Z., Kobayashi, H.: An efficient forward-backward algorithm for an explicit-duration hidden markov model. IEEE Signal Processing Letters 10, 11–14 (2003) https://doi.org/10.1109/LSP.2002.806705
- [27]Bulla, J., Bulla, I., Nenadić, O.: hsmm — an r package for analyzing hidden semi-markov models. Computational Statistics & Data Analysis 54(3), 611–619 (2010) https://doi.org/10.1016/j.csda.2008.08.025 . Second Special Issue on Statistical Algorithms and Software
- [28]O’Connell, J., Højgaard, S.: Hidden semi markov models for multiple observation sequences: The mhsmm package for r. Journal of Statistical Software 39(4), 1–22 (2011) https://doi.org/10.18637/jss.v039.i04
- [29]Cox, D.R., Miller, H.D.: The Theory of Stochastic Processes. Chapman and Hall, London (1965)
- [30]Russell, M.J., Cook, A.E.: Experimental evaluation of duration modelling techniques for automatic speech recognition. In: Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), pp. 2376–2379 (1987)DOI
- [31]Guédon, Y.: Hidden hybrid Markov/semi-Markov chains. Computational Statistics & Data Analysis 49(3), 663–688 (2005) https://doi.org/10.1016/j.csda.2004.05.033
- [32]Johnson, M.T.: Capacity and complexity of HMM duration modeling techniques. IEEE Signal Processing Letters 12(5), 407–410 (2005) https://doi.org/10.1109/LSP.2005.845598
- [33]Johnson, M.J., Willsky, A.S.: Bayesian nonparametric hidden semi-markov models. Journal of Machine Learning Research 14(20), 673–701 (2013)arxiv.org/abs/1203.1365
- [34]Kristensen, K., Nielsen, A., Berg, C.W., Skaug, H.J., Bell, B.: TMB: Automatic differentiation and laplace approximation. Journal of Statistical Software 70(5), 1–21 (2016) https://doi.org/10.18637/jss.v070.i05
- [35]Scrucca, L., Fop, M., Murphy, T.B., Raftery, A.E.: mclust 5: clustering, classification and density estimation using Gaussian finite mixture models. The R Journal 8(1), 289–317 (2016)pubmed.ncbi.nlm.nih.gov/27818791
- [36]Chalifour, M.: Comparison of sleep state classification performance using random forests, hidden markov models, and non-homogeneous hidden markov models. Master’s thesis, University of Alberta (2020)DOI
- [37]Zung, W.W.K., Naylor, T.H., Gianturco, D.T., Wilson, W.P.: Computer simulation of sleep eeg patterns with a markov chain model. In: Wortis, J. (ed.) Recent Advances in Biological Psychiatry: The Proceedings of the Twentieth Annual Convention and Scientific Program of the Society of Biological Psychiatry, New York City, April 30–May 2,1965, pp. 335–355. Springer, Boston, MA (1966). https://doi.org/10.1007/978-1-4899-7313-9_36
- [38]Yang, M.C., Hursch, C.J.: The semi-markov model for describing sleep patterns. Biometries 29(4), 667–676 (1973)pubmed.ncbi.nlm.nih.gov/4785232
- [39]Kemp, B., Kamphuisen, H.: Simulation of human hypnograms using a markov chain model. Sleep 9(3), 405–414 (1986) https://doi.org/10.1093/sleep/9.3.405
- [40]Penny, W.D., Roberts, S.J.: Gaussian observation hidden markov models for eeg analysis. Imperial College TR-98-12, London, UK, Tech. Rep (1998)
- [41]Flexerand, A., Dorffner, G., Sykacekand, P., Rezek, I.: An automatic, continuous and probabilistic sleep stager based on a hidden markov model. Applied Artificial Intelligence 16(3), 199–207 (2002) https://doi.org/10.1080/088395102753559271 https://doi.org/10.1080/088395102753559271
- [42]Flexer, A., Gruber, G., Dorffner, G.: A reliable probabilistic sleep stager based on a single eeg signal. Artificial Intelligence in Medicine 33(3), 199–207 (2005) https://doi.org/10.1016/j.artmed.2004.04.004
- [43]Doroshenkov, L., Konyshev, V., Selishchev, S.: Classification of human sleep stages based on eeg processing using hidden markov models. Biomedical Engineering 41(1), 25–28 (2007)pubmed.ncbi.nlm.nih.gov/17419342
- [44]Pan, S.-T., Kuo, C.-E., Zeng, J.-H., Liang, S.-F.: A transition-constrained discrete hidden markov model for automatic sleep staging. Biomedical engineering online 11(1), 52 (2012)DOI
- [45]Chen, Y., Zhu, X., Chen, W.: Automatic sleep staging based on ecg signals using hidden markov models. In: 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), pp. 530–533 (2015). IEEEDOI
- [46]Fischer, M., Kashlak, A.B., Chalifour, M., Heo, G.: Optimal semi-markov model selection for pediatric obstructive sleep apnea patient data. Data Analysis in the AI Era: Models, Methods and Techniques 14, 31–41 (2026)
- [47]Bulla, J.: Application of hidden markov models and hidden semi-markov models to financial time series. PhD thesis, Georg-August-Universität Göttingen, Göttingen, Germany (2006). https://doi.org/10.53846/geodiss-3687 . https://ediss.uni-goettingen.de/handle/11858/00-1735-0000-000D-F27C-7





