Time-Aware HMMs with Compound States
Problem
Stationarity fails when transitions differ by season. In the 2024 Q8 weather HMM, is much higher in October (heading into winter) than in April (heading into summer). The standard model averages these together, giving a single number that is wrong in both seasons.
Solution: Compound States
Rather than abandoning the stationary HMM formalism, change the definition of the state space to encode time information. Create compound states that pair the original state with a temporal marker.
Original:
Transition matrix is . All months share the same transitions. Seasonality is averaged away.
New:
Transition matrix is . Transitions are now season-specific. The stationary assumption still holds within each compound state, but the richer state space captures the seasonal differences.
Data Transformation
Label each month with its season. For UK weather: October–March is Winter, April–September is Summer. Relabel each state-timestep pair:
| Month | Original State | Season | Compound State |
|---|---|---|---|
| Oct | NF | Winter | |
| Nov | NF | Winter | |
| Dec | F | Winter | |
| Jan | F | Winter | |
| Feb | F | Winter | |
| Mar | NF | Winter | |
| Apr | F | Summer | |
| May | NF | Summer | |
| Jun | NF | Summer |
(For illustration; the 2024 solution uses three seasons: Autumn, Winter, Spring, Summer.)
Re-Estimate Parameters
Count transitions and emissions from the relabelled data as usual. The critical outcome:
During Summer, transitioning from NotFreezing to Freezing is extremely unlikely (perhaps even zero). During Winter, it is substantially more likely. The compound-state model captures this because and are estimated from different subsets of the training data — the winter months and the summer months, respectively.
2024 Q8 Solution Matrices
The official solution uses five compound states: (Autumn), , , , . Transition matrix:
| From / To | |||||
|---|---|---|---|---|---|
| 1/2 | 1/2 | 0 | 0 | 0 | |
| 0 | 2/3 | 1/3 | 0 | 0 | |
| 0 | 0 | 0 | 1/2 | 1/2 | |
| 0 | 0 | 1 | 0 | 0 | |
| 0 | 0 | 0 | 0 | 0 |
The emission matrix is similarly re-estimated per compound state. The model now predicts: July with is always Dry; snow is only possible from ; transitions follow the seasonal calendar.
Choosing the Right Granularity
Adding individual months (12 compound states) creates too much sparsity: “February is freezing” appears exactly once, so is unreliable. Grouping into 2–4 seasons is the sweet spot — enough data per state for reliable estimates while still capturing seasonal variation.
Trade-offs
| Aspect | Original HMM | Compound-State HMM |
|---|---|---|
| States | ||
| size | (or larger) | |
| Data per state | All months pooled | Only months in that season |
| Seasonality | Averaged away, wrong everywhere | Captured explicitly |
| Sparsity risk | Low | Higher (fewer data per state) |
| Predictive accuracy | Poor in transitional seasons | Better across all seasons |
General Principle
Compound states are the standard exam technique for injecting time-awareness into a stationary HMM. The trick is not to modify the HMM mathematics (the model remains a standard stationary HMM) but rather to redefine the state space so that the stationary assumption plausibly holds within each new state. The richer state space encodes the temporal information that the original model averaged away.
Summary
| Aspect | Key Point |
|---|---|
| Problem | Stationarity fails — different transitions per season |
| Solution | Compound states = original state season |
| Transformation | Relabel each pair with its season |
| Key result | |
| Granularity | Seasons (2–4 groups), not individual months (too sparse) |
Past paper questions: y2024p3q8