When the real state is hidden from view
Learn how observable clues can be used to infer hidden states and recover the most likely explanation underneath a sequence.
Before We Begin
Hidden Markov models separate the world into what we can observe and what we believe is happening underneath. The hidden state evolves over time, emits visible evidence, and must be inferred from those observations using probability.
How this lesson fits
Some data points only make sense when you know what came before them. This module studies models built for ordered information such as language, audio, weather, and time series, where sequence and memory matter as much as the current input.
The big question
How can a model represent the past well enough to make a strong decision about what is happening now or what should happen next?
Why You Should Care
Many important variables in AI are not directly visible: intent, disease status, topic, emotion, part-of-speech, or system mode. HMMs teach students how to reason formally about hidden causes from observable evidence.
Where this is used today
Think of it like this
It is like trying to infer tomorrow's weather pattern from cloud cover, temperature, and wind. You never see the abstract weather 'state' directly, but the clues it leaves behind make some hidden explanations more likely than others.
Easy mistake to make
A hidden state is not mystical or unknowable. It is simply a variable we do not observe directly and must infer from noisy evidence.
Think about this first
Name a situation where you cannot directly observe the true state of something but can still make a strong guess from clues. What evidence would increase or reduce your confidence?
Words we will keep using
Think of this as the "Sherlock Holmes" model. You never see the crime (hidden state), only the clues left behind (observations). The HMM is a mathematical tool for working backwards from the clues to the likely truth.
| From\To | Sunny | Rainy |
|---|---|---|
| Sunny | 0.7 | 0.3 |
| Rainy | 0.4 | 0.6 |
| State\Obs | 🚶 Walk | 🛍️ Shop | 🧹 Clean |
|---|---|---|---|
| Sunny | 0.6 | 0.3 | 0.1 |
| Rainy | 0.1 | 0.4 | 0.5 |
The Viterbi algorithm asks: "What is the single most likely story that explains these clues?" It finds the best path through the possibilities without getting lost in the details.
Trellis diagram: columns = time steps, rows = hidden states. Highlighted nodes/edges = Viterbi decoded path. Numbers inside nodes = Viterbi probability.
| Step | Observation | P(Sunny) | P(Rainy) | Most Likely State |
|---|---|---|---|---|
| t=0 | 🚶 Walk | 0.36000 | 0.04000 | Sunny |
| t=1 | 🚶 Walk | 0.15120 | 0.01080 | Sunny |
| t=2 | 🛍️ Shop | 0.03175 | 0.01814 | Sunny |
Applications: speech recognition, gesture recognition, biological sequence analysis, and any situation where an invisible process leaves visible traces behind.