UAV Systems Engineering · Module 3
M3-T1: Probability and uncertainty in robotics
A state estimate is a belief, not a number: the probability tools of this lesson are the language of every filter that follows.
An estimator does not know where the vehicle is; it holds a belief and updates it as measurements arrive. This lesson sets out the few probability ideas needed: random variables, moments, independence, conditioning and Bayes’ rule.
Learning objectives
After this lesson, you should be able to:
- Define a random variable, its mean and variance, and estimate them from samples.
- Distinguish independence from uncorrelatedness.
- Apply Bayes’ rule to update a discrete belief with a measurement.
- Explain why robotics represents uncertainty explicitly.
Conceptual explanation
The vehicle’s position, a sensor’s noise and the wind are random variables: quantities whose value is uncertain and described by a probability distribution. The mean (expectation) is the average value, the variance measures spread. Two variables are independent when knowing one tells nothing about the other; conditional probability ( | ) is the belief about after observing .

Engineering intuition
A single number hides the one thing a safety-conscious system needs: how wrong it might be. Two estimates of 10.0 m altitude, one with ±0.1 m and one with ±3 m, call for entirely different decisions near the ground. Probability gives the vocabulary: every quantity carries an uncertainty, sensors are likelihoods, and fusion is Bayes’ rule applied repeatedly.
Independence is the assumption that makes fusion cheap and the one that is most often violated: two filters fed by the same IMU are not independent, and treating them so double-counts information (lesson M3-T11).
Mathematical formulation
Bayes’ rule for a state and a measurement :
For two independent measurements , of the same state, the posterior is proportional to : evidence multiplies, so log-probabilities add. Sample estimates: mean with standard error , variance .
- (x)
- prior belief (before the measurement).
- (|)
- likelihood: how probable the measurement is for each possible state.
- (|)
- posterior belief (after the measurement).
Architecture and data flow
In an estimator the belief is carried as parameters: a mean and covariance (Kalman filter), a set of weighted samples (particle filter) or a grid of probabilities (histogram filter). Sensors supply likelihoods, parameterised by a noise model, whose parameters (lesson M3-T7) must be measured, not guessed.
Real-world UAV applications
- Modelling GNSS, barometer and IMU noise.
- Deciding thresholds for fault detection (lesson M3-T14).
- Particle filters for global localisation.
- Risk assessment: probability of leaving a corridor given position uncertainty.
Implementation example
This runs as shown: a discrete Bayes update (which of ten cells the vehicle is in, from a noisy door detector), the sample-statistics estimates and the independence versus uncorrelated example.
import numpy as np
rng = np.random.default_rng(0)
# 1) discrete Bayes: a corridor of 10 cells with doors at cells 1, 4 and 8; a noisy door sensor
doors = np.zeros(10); doors[[1, 4, 8]] = 1
def likelihood(z_door): return np.where(doors == 1, 0.8 if z_door else 0.2, 0.1 if z_door else 0.9) # p(z | cell)
belief = np.full(10, 0.1) # uniform prior
for z in (1,):
belief = belief * likelihood(z); belief /= belief.sum() # Bayes: multiply and normalise
print("belief after a door detection:", np.round(belief, 3))
assert abs(belief.sum() - 1) < 1e-12 and belief[[1, 4, 8]].sum() > 0.7 and belief[0] < 0.04
# 2) sample statistics and the standard error
x = 10 + 0.5 * rng.standard_normal(2500)
assert abs(x.mean() - 10) < 4 * 0.5 / np.sqrt(len(x)) and abs(x.std(ddof=1) - 0.5) < 0.03
# 3) uncorrelated is not independent: y = x^2 for symmetric x has zero covariance but is fully dependent
u = rng.standard_normal(200000); v = u ** 2
print("cov(u, u^2) =", round(float(np.cov(u, v)[0, 1]), 4))
assert abs(np.cov(u, v)[0, 1]) < 0.02 and abs(np.corrcoef(np.abs(u), v)[0, 1]) > 0.8 # dependent through |u|
# 4) evidence multiplies: two door detections at different times narrow the belief
b2 = belief * likelihood(0); b2 /= b2.sum() # then "no door": the belief moves away from the doors
assert b2[[1, 4, 8]].sum() < belief[[1, 4, 8]].sum()Common engineering mistakes
Reporting a state without uncertainty
Downstream consumers cannot weigh it.
Assuming independence of sensors that share a source
Information is double-counted.
Confusing variance and standard deviation in a configuration file
A squared value where a standard deviation is expected changes the weighting a lot.
Treating noise as Gaussian without checking
Heavy tails (outliers) are common (lesson M3-T14).
Using sample variance with N instead of N−1
A small bias that matters with few samples.
Failure modes
| Failure mode | How it shows up | Likely cause |
|---|---|---|
| Overconfidence | State claimed too certain, then wrong | Noise underestimated or correlation ignored |
| Double counting | Covariance shrinks faster than the error | Correlated measurements treated as independent |
| Units mismatch | Weights off by a factor squared | Variance versus standard deviation |
| Non-Gaussian outliers | Occasional large errors | Gaussian assumption violated |
Debugging approach
- Histogram the measurement noise from a stationary log and compare to a Gaussian fit.
- Check sample mean and variance against the datasheet.
- Write units on every noise parameter.
- Compute the correlation between sensor errors.
Practical exercises
- Compute the posterior if the sensor says “door” twice in a row at the same cell.
- Show that two variables with zero covariance can be dependent (another example).
- Estimate how many samples are needed to know a noise standard deviation to 5%.
- Derive the posterior for a Gaussian prior and a Gaussian likelihood in one dimension.
Interview questions
Write an answer in your own words, then reveal the model answer. Nothing is sent anywhere.
Question 1
Is zero correlation the same as independence?
Model answer
No: independent variables are uncorrelated, but uncorrelated variables can be dependent; Gaussian jointly distributed variables are the exception.
Question 2
What does Bayes’ rule do in an estimator?
Model answer
It combines the prior belief with the measurement likelihood and normalises to give the posterior: evidence multiplies.
Question 3
Why must a state estimate carry uncertainty?
Model answer
Decisions depend on how wrong the estimate may be, not only its value.
References and further reading
Primary papers, official documentation and standards. Each claim above that is specific to a tool or version points here.
- S. Thrun, W. Burgard, D. Fox, Probabilistic Robotics, MIT Press, 2005, chapters 2 and 4
- . . Barfoot, State Estimation for Robotics, Cambridge University Press, 2017, chapter 2.
- A. Papoulis, . . Pillai, Probability, Random Variables and Stochastic Processes, 4th ed., McGraw-Hill, 2002.