4  Observation models

Chapter 3 treated the emission densities \(f_i\) as given. This chapter is about choosing them, and about what that choice determines.

More rides on it than is obvious. The emission family fixes what a state can mean, how expensive the M-step of Chapter 6 is, whether the likelihood is bounded, and — through the identifiability results at the end — whether the parameters can be recovered at all.

By the end of this chapter you will be able to

  • match an emission family to a data type, and say what goes wrong when the match is poor;
  • recognise an exponential-family emission model and write down the M-step it implies;
  • build covariate dependence into either the emissions or the transitions;
  • distinguish label switching from structural non-identifiability, and state a checkable condition under which an HMM is identified.

4.1 Choosing an emission family

The state-dependent distributions \(\{F_i\}_{i \in E}\), with densities \(f_i\) against a common dominating measure \(\nu\), are where the modelling happens.

When \(\mathcal{Y} = \{1,\dots,M\}\) is finite, each state carries a probability vector, \[ b_i(y) = \mathbb{P}(Y_t = y \mid S_t = i), \qquad \sum_{y=1}^M b_i(y) = 1, \] collected into a \(K \times M\) emission matrix \(\mathbf{B}\).

This is the setting of the original HMM literature — Baum et al. (1970) for the algorithm, Rabiner (1989) for speech, Durbin et al. (1998) for biological sequences — and it remains the cleanest case for identifiability theory, because the model is then a finite-dimensional algebraic object and the tensor methods of Allman et al. (2009) apply directly.

The parameter count is \(K(M-1)\), which grows quickly in the alphabet size. For large \(M\) that is the binding constraint, and it is why speech systems moved from free tables to parametric or neural emission scores.

When \(\mathcal{Y} \subseteq \mathbb{R}^d\), each state carries a density against Lebesgue measure. Gaussian emissions \(f_i = \mathcal{N}(\cdot\,;\mu_i,\Sigma_i)\) are the default and give the state a direct reading as a regime with its own level and variability.

Mixtures of Gaussians within each state add flexibility at the cost of a second layer of label ambiguity. Heavy-tailed alternatives such as the Student \(t\) guard against a well-known failure: an outlier can otherwise capture a state of its own, driving that state’s variance towards zero.

That degeneracy is not a numerical accident but a property of the model — see the warning below.

Most standard families fit Definition 1.13, with state \(i\) carrying its own natural parameter: \[ f_i(y) = h(y)\exp\bigl\{\langle \eta_i, T(y)\rangle - A(\eta_i)\bigr\}. \]

The payoff is computational. The M-step of EM reduces to \[ \nabla A(\eta_i) \;=\; \frac{\sum_{t=1}^T \gamma_t(i)\,T(y_t)}{\sum_{t=1}^T \gamma_t(i)}, \] a weighted moment-matching problem with the same form as the complete-data problem. Only weighted sufficient statistics need accumulating, so the E-step and M-step communicate through a fixed, small amount of information regardless of \(T\).

Nothing forces emission parameters to be constant. Writing \(f_i(y_t;\phi_i,x_t)\) for a state-dependent regression on covariates turns the HMM into a Markov-switching regression: states index regimes, each with its own coefficient vector.

Transitions can depend on covariates in the same way, through a multinomial logit, \[ \gamma_{ij}(x_t) = \frac{\exp(\beta_{ij}^\top x_t)}{\sum_{l=1}^{K}\exp(\beta_{il}^\top x_t)}, \] with one column constrained for identification. The chain is then time-inhomogeneous in the sense of Chapter 2, but the recursions of Chapter 5 are unaffected: they never used homogeneity, only the factorisation of Theorem 3.1.

4.1.1 What to use when

Emission families in common use, following Zucchini et al. (2016, ch. 8)
Data type Emission family Typical use
Counts Poisson, negative binomial event counts per interval; overdispersion via the latter
Binary or categorical Bernoulli, multinomial sequence labelling, symbol streams
Continuous, unbounded Gaussian, Student \(t\) returns, sensor readings
Continuous, positive gamma, log-normal, Weibull durations, step lengths
Angular von Mises, wrapped Cauchy turning angles in movement models
Multivariate multivariate normal, copula constructions joint sensor or biomarker panels

The rule behind the table is that the support of the family should match the support of the data. A Gaussian fitted to a strictly positive variable puts mass below zero, and the model compensates by manufacturing a state to handle the boundary — a spurious state that then gets interpreted as real.

WarningUnconstrained Gaussian emissions make the likelihood unbounded

Put \(\mu_i = y_1\) for some state \(i\) and let \(\sigma_i \to 0\). The term \(f_i(y_1)\) diverges while every other factor stays bounded away from zero, so \(L_T(\theta) \to \infty\).

The supremum is therefore not attained at any sensible parameter value, and “the maximum likelihood estimator” has to mean a suitable local maximum. In practice: bound the variances away from zero, use a prior that does it for you (Chapter 9), or choose a family whose scale cannot collapse. The same problem afflicts finite Gaussian mixtures and is not specific to HMMs.

Example 4.1 (The occasionally dishonest casino) A dealer alternates between a fair die and a loaded one. Hidden states are \(E = \{\text{fair},\text{loaded}\}\); observations are face values \(\mathcal{Y} = \{1,\dots,6\}\); emissions are \(b_{\text{fair}}(y) = 1/6\) and \(b_{\text{loaded}}(6) = 1/2\) with \(b_{\text{loaded}}(y) = 1/10\) otherwise; and the transition matrix has large diagonal entries, so switches are rare.

Every inference question has a reading here. Filtering asks whether the die in play right now is loaded. Smoothing asks the same with hindsight. Viterbi decoding asks for the single most plausible sequence of switches. Durbin et al. (1998, ch. 3) use this example throughout, and it is the cheapest way to build intuition for why the three answers differ.

Check your understanding. You are modelling daily rainfall totals, which are zero on many days and positive otherwise. Why is a Gaussian emission a poor choice, and what would you do instead?

Two problems. The support is wrong — a Gaussian puts mass on negative rainfall — and the data have an atom at zero, which no continuous density can represent.

The usual fix is a hurdle construction: model \(\mathbb{P}(Y_t = 0 \mid S_t = i) = p_i\) and, conditional on being positive, use a gamma or log-normal density. That is still an emission distribution in the sense of Definition 3.2 — the dominating measure is counting measure at \(\{0\}\) plus Lebesgue measure on \((0,\infty)\) — so every algorithm in these notes applies unchanged. This is precisely what the dominating-measure convention in Chapter 3 buys.

4.2 Identifiability

Two parameter values that induce the same distribution for the observed process cannot be distinguished by any amount of data. For HMMs this happens for one unavoidable reason, covered in Chapter 3, and several avoidable ones.

4.2.1 The unavoidable part

Proposition 3.2 established that permuting state labels leaves the law of \(Y_{1:T}\) unchanged. Identifiability can therefore only ever be claimed up to permutation, and the parameter is properly thought of as an unordered set of states. Nothing scientific is lost, since labels mean nothing.

4.2.2 The avoidable part

Beyond permutation, identifiability can fail for reasons that signal a badly posed model.

Duplicated states. If \(f_i = f_j\) and rows \(i\) and \(j\) of \(\boldsymbol{\Gamma}\) agree, the two states are observationally identical and can be merged, leaving a continuum of parameter values with the same likelihood.

Empty states. If \(\pi_i = 0\) then \(\phi_i\) never enters the likelihood and is unidentified — the data say nothing about a state that is never visited.

Overparameterised emissions. If the \(f_i\) are linearly dependent as functions, for instance if one state’s density is a mixture of the others’, then transition and emission parameters can trade off against one another.

The first two are symptoms of fitting too many states. That is exactly the question Chapter 11 addresses, by treating \(K\) as unknown and separating the number of states in the model from the number the data actually occupy.

4.2.3 When identifiability does hold

The positive results are sharper than one might expect.

Theorem 4.1 (Identifiability from three consecutive observations) Let \((S_t,Y_t)\) be a stationary HMM with \(K\) states, transition matrix \(\boldsymbol{\Gamma}\) of full rank \(K\), and stationary distribution \(\boldsymbol{\pi}\) with \(\pi_i > 0\) for all \(i\). If the emission distributions \(F_1,\dots,F_K\) are linearly independent, then the law of \((Y_1,Y_2,Y_3)\) determines \(\boldsymbol{\Gamma}\) and \(\{F_i\}\) up to permutation of the states.

The result is due to Allman et al. (2009). The joint law of three consecutive observations is written as a three-way tensor whose factors are the emission distributions, and Kruskal’s uniqueness theorem for trilinear decompositions (Kruskal 1977) gives the conclusion.

What makes it striking is that three time points suffice. No asymptotic argument is needed, and both conditions are checkable in practice. Linear independence is also much weaker than distinctness: it fails only when one emission distribution is an affine combination of the others.

The same tensor structure is what Hsu et al. (2012) turn into a spectral estimation algorithm with polynomial sample complexity, and it extends to fully nonparametric emissions, where the \(F_i\) are left unspecified and only linear independence is assumed (Gassiat et al. 2016). Petrie (1969) gave the first identifiability results for finite emissions, long before the tensor machinery existed.

Check your understanding. A fitted two-state model has \(\hat\mu_1 = 2.01\), \(\hat\mu_2 = 2.03\), \(\hat\sigma_1 = \hat\sigma_2 = 1.4\), and nearly identical rows of \(\hat{\boldsymbol{\Gamma}}\). Which hypothesis of Theorem 4.1 is in trouble, and what should you do?

Linear independence of the emission distributions is close to failing: \(F_1\) and \(F_2\) are almost the same distribution, so the tensor in the Kruskal argument is near-singular and the parameters are weakly identified. The near-identical transition rows compound it — this is the duplicated-states case above, approached from close by.

Expect huge standard errors, EM iterates that drift for many iterations while the likelihood barely moves, and fits that vary wildly across starting values. The right response is to fit \(K = 1\) and compare, not to try harder to estimate a model the data do not support.

4.3 Model checking

Choosing a family is a modelling decision, so it should be checked rather than assumed. Two tools carry most of the load.

Pseudo-residuals. With \(u_t = F(y_t \mid y_{1:t-1})\) the one-step predictive CDF evaluated at the observation, the transformed values \(\Phi^{-1}(u_t)\) are approximately independent standard normal under correct specification. Quantile plots of these detect a mismatched emission family directly, and the predictive densities they need are already produced by the forward recursion (Proposition 5.1). Zucchini et al. (2016, ch. 6) develop this in detail.

Posterior predictive checks. Simulate series from the fitted model and compare features the model was not fitted to — the marginal distribution, the autocorrelation function, the distribution of run lengths within a state. Run lengths are especially informative, because assumption (A1) forces them to be geometric, and a mismatch there points to a hidden semi-Markov model rather than to a different emission family.

4.4 Summary

  • The emission family determines what a state can mean, how expensive the M-step is, and whether the likelihood is bounded.
  • Match the support of the family to the support of the data; a mismatch makes the model manufacture states to cover the boundary.
  • Exponential-family emissions reduce the M-step to weighted moment matching, which is why they dominate in practice.
  • Covariate dependence can enter through the emissions, the transitions, or both, and costs nothing algorithmically.
  • Identifiability holds up to permutation and no better (Proposition 3.2). Under full rank of \(\boldsymbol{\Gamma}\) and linear independence of the emissions, three consecutive observations suffice (Theorem 4.1).

4.5 Further reading

Zucchini et al. (2016, chs. 6, 8) catalogue emission families with worked examples and develop pseudo-residual diagnostics. Cappé et al. (2005, ch. 1) gives the measure-theoretic construction. For identifiability, read Allman et al. (2009) first and then Gassiat et al. (2016) for the nonparametric extension; Hsu et al. (2012) turns the same algebra into an estimator. Murphy (2012, ch. 17) and Bishop (2006, ch. 13) place the model within the wider graphical model framework.