Process Noise Covariances (Q)
Measurement Noise Covariances (R)
Kalman Filter Tuning Theory
Process Noise Covariance (Q)
The process noise matrix Q represents uncertainty in the system model. It accounts for unmodeled
dynamics, linearization errors, and external disturbances:
Q = E[w · wᵀ] where w ~ N(0, Q)
Larger Q → Filter trusts measurements more (faster response, less smooth)
Smaller Q → Filter trusts model more (slower response, smoother)
Measurement Noise Covariance (R)
The measurement noise matrix R represents sensor accuracy and reliability:
R = E[v · vᵀ] where v ~ N(0, R)
R should match actual sensor noise characteristics
R_sensor = σ²_sensor (variance of sensor measurements)
Kalman Gain
The Kalman gain K determines how much the filter trusts measurements vs. predictions:
K = P⁻ · Hᵀ · (H · P⁻ · Hᵀ + R)⁻¹
K → 0: Trust model (R large or P small)
K → 1: Trust measurement (R small or P large)
Filter Consistency
A well-tuned filter should be consistent - actual errors should match predicted uncertainty:
Consistency = (actual_error within predicted_uncertainty) / total_samples
Target: 68% for 1σ bounds, 95% for 2σ bounds
Tuning Guidelines
- Start Conservative: Begin with larger Q and R values
- Match Sensor Specs: Set R based on manufacturer datasheets
- Tune Q Iteratively: Adjust Q to achieve desired responsiveness
- Check Innovation: Innovation sequence should be zero-mean white noise
- Validate Consistency: Actual errors should stay within uncertainty bounds
Common Tuning Issues
Q too small: Filter overconfident, rejects good measurements, diverges
Q too large: Filter jittery, follows measurement noise, poor smoothing
R too small: Filter overweights noisy measurements, unstable estimates
R too large: Filter ignores measurements, poor correction