Chapter 6: Probabilistic Robotics Foundations
Lesson 4: Independence Assumptions and Their Limits
This lesson formalizes the independence assumptions that make Bayes filtering computationally tractable for mobile robots, and then rigorously analyzes when these assumptions break. We prove the standard Bayes-filter factorization, derive the quantitative overconfidence that arises when correlated measurements are (incorrectly) treated as conditionally independent, and show how state augmentation can restore the Markov property in the presence of hidden biases and temporal correlations. Practical diagnostics and mitigation strategies are given, along with multi-language implementations.
1. Conceptual Overview
In Chapter 6 so far, we defined the belief \( \text{bel}(x_t) = p(x_t \mid z_{1:t}, u_{1:t}) \) and introduced Bayes filters as recursive estimators. The recursion is only possible because we impose conditional independence and Markov assumptions that simplify high-dimensional joint distributions.
The core idea is to encode “what depends on what” so that the belief update can be computed with manageable complexity. These assumptions are not merely “convenient”: they are structural statements about the robot, sensors, and environment. When violated (e.g., correlated sensor errors, shared biases, time-correlated disturbances), the filter can become overconfident and systematically wrong.
flowchart LR
X1["x(t-1)"] --> X2["x(t)"]
U["u(t)"] --> X2
X2 --> Z["z(t)"]
ZP["z(1:t-1)"] -. "ignored given x(t)" .-> Z
XP["x(0:t-2)"] -. "ignored given x(t-1),u(t)" .-> X2
The dashed relations above indicate the key conditional independences: (i) first-order state evolution, and (ii) measurements depending only on the current state. In later sections, we quantify how violations create systematic errors.
2. Formal Independence Assumptions in Bayes Filtering
Let the robot state be \( x_t \), controls \( u_t \), and measurements \( z_t \). The full smoothing posterior is \( p(x_{0:t} \mid z_{1:t}, u_{1:t}) \), but the Bayes filter tracks only \( p(x_t \mid z_{1:t}, u_{1:t}) \).
Assumption A (State Markov property):
\[ p(x_t \mid x_{0:t-1}, u_{1:t}) = p(x_t \mid x_{t-1}, u_t). \]
Assumption B (Measurement conditional independence):
\[ p(z_t \mid x_{0:t}, z_{1:t-1}, u_{1:t}) = p(z_t \mid x_t). \]
Together, these assumptions yield the standard Bayes-filter recursion. We state it as a theorem and prove it from first principles.
Theorem 1 (Bayes filter factorization): Under Assumptions A and B, the belief satisfies
\[ \text{bel}(x_t) = \eta \, p(z_t \mid x_t)\int p(x_t \mid x_{t-1}, u_t)\,\text{bel}(x_{t-1})\,dx_{t-1}, \quad \eta^{-1} = \int p(z_t \mid x_t)\,\overline{\text{bel}}(x_t)\,dx_t. \]
Proof:
Start from the definition: \( \text{bel}(x_t) = p(x_t \mid z_{1:t}, u_{1:t}) \). By Bayes’ rule:
\[ p(x_t \mid z_{1:t}, u_{1:t}) = \frac{p(z_t \mid x_t, z_{1:t-1}, u_{1:t})\,p(x_t \mid z_{1:t-1}, u_{1:t})}{p(z_t \mid z_{1:t-1}, u_{1:t})}. \]
Apply Assumption B to simplify the likelihood: \( p(z_t \mid x_t, z_{1:t-1}, u_{1:t}) = p(z_t \mid x_t) \). Let the normalizer be \( \eta = 1 / p(z_t \mid z_{1:t-1}, u_{1:t}) \), giving:
\[ \text{bel}(x_t) = \eta\, p(z_t \mid x_t)\, p(x_t \mid z_{1:t-1}, u_{1:t}). \]
Now expand the predictive term by marginalization over \( x_{t-1} \):
\[ p(x_t \mid z_{1:t-1}, u_{1:t}) = \int p(x_t \mid x_{t-1}, z_{1:t-1}, u_{1:t})\,p(x_{t-1} \mid z_{1:t-1}, u_{1:t})\,dx_{t-1}. \]
Apply Assumption A and the fact that \( x_{t-1} \) is determined before applying \( u_t \):
\[ p(x_t \mid x_{t-1}, z_{1:t-1}, u_{1:t}) = p(x_t \mid x_{t-1}, u_t), \qquad p(x_{t-1} \mid z_{1:t-1}, u_{1:t}) = p(x_{t-1} \mid z_{1:t-1}, u_{1:t-1}). \]
Recognize \( p(x_{t-1} \mid z_{1:t-1}, u_{1:t-1}) = \text{bel}(x_{t-1}) \), yielding:
\[ p(x_t \mid z_{1:t-1}, u_{1:t}) = \int p(x_t \mid x_{t-1}, u_t)\,\text{bel}(x_{t-1})\,dx_{t-1}. \]
Substitution completes the recursion. \(\blacksquare\)
This proof highlights exactly where independence enters: the likelihood simplification and the prediction factorization.
3. Multi-Sensor Conditional Independence and Naive Fusion
Often \( z_t \) is a vector of readings from multiple sensors (or multiple extracted features): \( z_t = (z_t^{(1)}, \dots, z_t^{(m)}) \). A common modeling step is:
\[ p(z_t \mid x_t) = \prod_{i=1}^{m} p\!\big(z_t^{(i)} \mid x_t\big). \]
This is a conditional independence assumption: the sensors may be correlated marginally, but become independent once \( x_t \) is known. It is justified when sensor noises are generated by independent physical processes and there are no shared systematic errors.
When it is (approximately) reasonable:
- Distinct modalities with separate noise sources (e.g., wheel odometry vs a range sensor) and negligible coupling.
- Independent feature extractors with non-overlapping data pipelines.
- Proper calibration removes shared biases so remaining errors are close to independent.
When it fails:
- Shared bias: both sensors depend on a common latent disturbance (temperature, timing skew, mounting flex).
- Shared data: two “different” features extracted from the same raw scan or image are correlated.
- Environmental coupling: multipath, occlusion, and surface properties jointly affect multiple readings.
- Time correlation: slow drift means today’s error is correlated with yesterday’s error (violates Assumption B over time).
The key consequence is typically double counting evidence: multiplying two likelihoods as if independent adds too much information and shrinks uncertainty too aggressively. Next, we quantify this effect analytically.
4. A Rigorous Limit Case — Correlated Gaussian Measurements
Consider a scalar state \( x \) (e.g., one pose component along a corridor) with Gaussian prior: \( x \sim \mathcal{N}(\mu_0,\sigma_0^2) \). Two sensors measure the same quantity: \( y_1 = x + v_1 \), \( y_2 = x + v_2 \), where \( (v_1,v_2) \) are jointly Gaussian with correlation \( \rho \).
Joint noise model:
\[ \mathbf{y} = \begin{bmatrix} y_1 \\ y_2 \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \end{bmatrix} x + \mathbf{v}, \qquad \mathbf{v} \sim \mathcal{N}\!\left(\mathbf{0}, \boldsymbol{\Sigma}\right), \quad \boldsymbol{\Sigma} = \sigma^2 \begin{bmatrix} 1 & \rho \\ \rho & 1 \end{bmatrix}, \quad -1 < \rho < 1. \]
The correct likelihood is \( p(\mathbf{y}\mid x) = \mathcal{N}(\mathbf{y}; \mathbf{1}x, \boldsymbol{\Sigma}) \). The independence approximation forces \( \rho = 0 \) and uses \( p(\mathbf{y}\mid x) \approx p(y_1\mid x)p(y_2\mid x) \).
Theorem 2 (Overconfidence from ignoring positive correlation): For \( \rho > 0 \), the posterior variance computed under the independence approximation is strictly smaller than the correct posterior variance.
Proof (closed form in information form):
In linear-Gaussian inference, the posterior precision (inverse variance) satisfies:
\[ \sigma_{\text{post}}^{-2} = \sigma_0^{-2} + \mathbf{1}^\top \boldsymbol{\Sigma}^{-1}\mathbf{1}, \qquad \mathbf{1} = \begin{bmatrix}1\\1\end{bmatrix}. \]
Compute \( \boldsymbol{\Sigma}^{-1} \) for \( \boldsymbol{\Sigma} = \sigma^2 \begin{bmatrix}1&\rho\\\rho&1\end{bmatrix} \):
\[ \boldsymbol{\Sigma}^{-1} = \frac{1}{\sigma^2(1-\rho^2)} \begin{bmatrix} 1 & -\rho \\ -\rho & 1 \end{bmatrix}. \]
Hence
\[ \mathbf{1}^\top \boldsymbol{\Sigma}^{-1}\mathbf{1} = \frac{1}{\sigma^2(1-\rho^2)} \Big((1-\rho) + (1-\rho)\Big) = \frac{2(1-\rho)}{\sigma^2(1-\rho^2)} = \frac{2}{\sigma^2(1+\rho)}. \]
Therefore the correct posterior variance is
\[ \sigma_{\text{post,corr}}^2 = \left(\sigma_0^{-2} + \frac{2}{\sigma^2(1+\rho)}\right)^{-1}. \]
Under independence, \( \rho = 0 \), so the (approximate) posterior variance is
\[ \sigma_{\text{post,ind}}^2 = \left(\sigma_0^{-2} + \frac{2}{\sigma^2}\right)^{-1}. \]
For \( \rho > 0 \), we have \( \frac{2}{\sigma^2} > \frac{2}{\sigma^2(1+\rho)} \), hence \( \sigma_{\text{post,ind}}^{-2} > \sigma_{\text{post,corr}}^{-2} \), which implies \( \sigma_{\text{post,ind}}^2 < \sigma_{\text{post,corr}}^2 \). \(\blacksquare\)
Interpretation: positive correlation means the two measurements contain less than “two independent units of information.” The independence approximation forces the filter to believe it has more information than it truly has, producing overconfident beliefs.
5. Violations of the Markov Property and State Augmentation
A frequent real AMR failure mode is unmodeled latent variables that create memory: wheel radius drift, IMU bias, clock skew, temperature-dependent scale, or ground-dependent slip persistence. Then the process is not Markov in the pose state alone.
Suppose the true dynamics depend on a hidden bias \( b_t \):
\[ x_t = f(x_{t-1}, u_t, b_{t-1}) + w_t, \qquad b_t = b_{t-1} + n_t, \]
where \( w_t \) is process noise and \( n_t \) is bias-drift noise. If we ignore \( b_t \), then \( p(x_t \mid x_{t-1},u_t) \) is generally misspecified because the transition depends on past through \( b_{t-1} \).
Key remedy (augmentation): define the augmented state
\[ \tilde{x}_t = \begin{bmatrix} x_t \\ b_t \end{bmatrix}. \]
Proposition 1 (Markov restoration via augmentation): If \( (x_t,b_t) \) evolves as above with independent noises \( (w_t,n_t) \), then the augmented state is first-order Markov:
\[ p(\tilde{x}_t \mid \tilde{x}_{0:t-1}, u_{1:t}) = p(\tilde{x}_t \mid \tilde{x}_{t-1}, u_t). \]
Proof:
By construction, \( \tilde{x}_t \) is generated from \( \tilde{x}_{t-1} \) and \( u_t \) through the pair of equations with fresh noises \( (w_t,n_t) \) that are independent of the past given \( \tilde{x}_{t-1} \). Therefore the conditional distribution of \( \tilde{x}_t \) depends on history only through \( \tilde{x}_{t-1} \) and \( u_t \). \(\blacksquare\)
This is a fundamental modeling principle: if independence assumptions fail due to hidden memory, expand the state until the “memory” becomes explicit. (In later chapters, this idea becomes central for robust localization and SLAM.)
6. Practical Diagnostics and Mitigation Workflow
Independence assumptions are modeling choices that should be validated against data. In AMRs, violations often appear as: (i) unexpectedly rapid shrinkage of uncertainty, (ii) inconsistent behavior across environments, or (iii) residuals that show correlation across sensors or time. Without relying on future chapters’ specialized consistency tests, we can still apply basic statistical checks.
flowchart TD
A["Start: choose a factorization for p(z|x) and p(x_t|x_t-1,u_t)"] --> B["Collect logs: controls + sensor streams"]
B --> C["Estimate correlations: corr(e_i, e_j), corr(e_t, e_t-1)"]
C --> D{"Correlations near zero?"}
D -->|yes| E["Keep independence model; \nproceed with Bayes update"]
D -->|no| F["Identify cause: shared bias / \nshared raw data / drift / coupling"]
F --> G["Mitigate: joint likelihood OR \nstate augmentation OR noise inflation"]
G --> H["Re-validate on held-out runs; \ncheck uncertainty shrinkage is plausible"]
Mitigation options (ordered by modeling fidelity):
- Joint likelihood modeling: replace \( \prod_i p(z^{(i)}\mid x) \) with a multivariate model \( p(\mathbf{z}\mid x) \).
- State augmentation: include shared bias/drift states so conditional independence becomes more accurate.
- Noise inflation / downweighting: enlarge measurement noise to avoid overconfidence when correlations are unknown.
7. Multi-Language Implementation Lab: Correlated Sensor Fusion
The following implementations reproduce Theorem 2 numerically by comparing the correct correlated posterior variance against the variance obtained when treating the two measurements as independent.
7.1 Python (NumPy; compatible with robotics stacks)
File: Chapter6_Lesson4.py
# Chapter6_Lesson4.py
# Independence Assumptions and Their Limits — correlated-sensor example for Bayesian fusion
#
# This script demonstrates how assuming conditional independence between measurements
# can lead to overconfident posteriors when sensor noises are correlated.
#
# Dependencies: numpy (standard). Optional: matplotlib for plotting.
#
# Usage:
# python Chapter6_Lesson4.py
import numpy as np
def posterior_from_two_measurements_correlated(mu0, sigma0, y, sigma, rho):
"""
Prior: x ~ N(mu0, sigma0^2)
Measurements: y = [y1, y2]^T = [x, x]^T + v, v ~ N(0, Sigma)
Sigma = sigma^2 [[1, rho], [rho, 1]]
Returns posterior mean and variance (scalar).
"""
y = np.asarray(y, dtype=float).reshape(2,)
Sigma = (sigma**2) * np.array([[1.0, rho], [rho, 1.0]], dtype=float)
# Information form: posterior precision = prior precision + H^T Sigma^{-1} H
# Here H = [1, 1]^T (2x1), so H^T Sigma^{-1} H is scalar.
Sinv = np.linalg.inv(Sigma)
info_meas = np.array([1.0, 1.0]) @ Sinv @ np.array([1.0, 1.0])
post_var = 1.0 / (1.0/(sigma0**2) + info_meas)
# mean: mu = var*( mu0/sigma0^2 + H^T Sigma^{-1} y )
info_vec = np.array([1.0, 1.0]) @ Sinv @ y
post_mean = post_var * (mu0/(sigma0**2) + info_vec)
return post_mean, post_var
def posterior_from_two_measurements_independent(mu0, sigma0, y, sigma):
"""
Same model but with independence assumption rho=0, i.e., Sigma = sigma^2 I.
Equivalent to multiplying two independent likelihoods N(y_i; x, sigma^2).
"""
y = np.asarray(y, dtype=float).reshape(2,)
# Closed form: posterior precision = 1/sigma0^2 + 2/sigma^2
post_var = 1.0 / (1.0/(sigma0**2) + 2.0/(sigma**2))
post_mean = post_var * (mu0/(sigma0**2) + np.sum(y)/(sigma**2))
return post_mean, post_var
def demo():
mu0, sigma0 = 0.0, 2.0
sigma = 1.0
y1, y2 = 1.0, 1.2
y = [y1, y2]
print("Prior: x ~ N(mu0, sigma0^2) with mu0=%.3f, sigma0=%.3f" % (mu0, sigma0))
print("Measurements: y1=%.3f, y2=%.3f, each with sigma=%.3f" % (y1, y2, sigma))
print()
for rho in [0.0, 0.3, 0.6, 0.9]:
m_corr, v_corr = posterior_from_two_measurements_correlated(mu0, sigma0, y, sigma, rho)
m_ind, v_ind = posterior_from_two_measurements_independent(mu0, sigma0, y, sigma)
# Overconfidence factor: how much smaller the independent variance is vs correct
overconf = v_ind / v_corr
print("rho=%.1f:" % rho)
print(" Correct correlated posterior: mean=%.6f, var=%.6f" % (m_corr, v_corr))
print(" Indep. assumption posterior: mean=%.6f, var=%.6f" % (m_ind, v_ind))
print(" Variance ratio (indep/correct) = %.6f ( < 1 means overconfident )" % overconf)
print()
# Optional visualization (safe if matplotlib exists)
try:
import matplotlib.pyplot as plt
rhos = np.linspace(0.0, 0.95, 20)
vars_corr = []
vars_ind = []
for rho in rhos:
_, v_corr = posterior_from_two_measurements_correlated(mu0, sigma0, y, sigma, rho)
_, v_ind = posterior_from_two_measurements_independent(mu0, sigma0, y, sigma)
vars_corr.append(v_corr)
vars_ind.append(v_ind)
plt.figure()
plt.plot(rhos, vars_corr, label="Correct correlated")
plt.plot(rhos, vars_ind, label="Assume independent (rho=0)")
plt.xlabel("Correlation rho")
plt.ylabel("Posterior variance")
plt.title("Effect of ignoring correlation on posterior variance")
plt.legend()
plt.grid(True)
plt.show()
except Exception as e:
print("Plot skipped (matplotlib not available or backend issue):", e)
if __name__ == "__main__":
demo()
7.2 C++ (Eigen; common in AMR estimation code)
File: Chapter6_Lesson4.cpp
// Chapter6_Lesson4.cpp
// Independence Assumptions and Their Limits — correlated-sensor Bayesian fusion (C++)
//
// Demonstrates overconfidence when measurement correlation is ignored.
//
// Dependencies: Eigen3 (common in robotics).
// Compile (example):
// g++ -O2 -std=c++17 Chapter6_Lesson4.cpp -I /usr/include/eigen3 -o ch6l4
// Run:
// ./ch6l4
#include <iostream>
#include <iomanip>
#include <Eigen/Dense>
struct Posterior {
double mean;
double var;
};
Posterior posterior_correlated(double mu0, double sigma0, const Eigen::Vector2d& y, double sigma, double rho) {
Eigen::Matrix2d Sigma;
Sigma << 1.0, rho,
rho, 1.0;
Sigma *= (sigma * sigma);
Eigen::Matrix2d Sinv = Sigma.inverse();
Eigen::Vector2d H;
H << 1.0, 1.0;
double info_meas = H.transpose() * Sinv * H; // scalar
double post_var = 1.0 / (1.0/(sigma0*sigma0) + info_meas); // scalar
double info_vec = H.transpose() * Sinv * y; // scalar
double post_mean = post_var * (mu0/(sigma0*sigma0) + info_vec);
return {post_mean, post_var};
}
Posterior posterior_independent(double mu0, double sigma0, const Eigen::Vector2d& y, double sigma) {
// rho=0 -> Sigma = sigma^2 I; precision additivity
double post_var = 1.0 / (1.0/(sigma0*sigma0) + 2.0/(sigma*sigma));
double post_mean = post_var * (mu0/(sigma0*sigma0) + (y(0) + y(1))/(sigma*sigma));
return {post_mean, post_var};
}
int main() {
double mu0 = 0.0;
double sigma0 = 2.0;
double sigma = 1.0;
Eigen::Vector2d y(1.0, 1.2);
std::cout << std::fixed << std::setprecision(6);
std::cout << "Prior: x ~ N(mu0, sigma0^2) with mu0=" << mu0 << ", sigma0=" << sigma0 << "\n";
std::cout << "Measurements: y1=" << y(0) << ", y2=" << y(1) << ", sigma=" << sigma << "\n\n";
for (double rho : {0.0, 0.3, 0.6, 0.9}) {
Posterior pc = posterior_correlated(mu0, sigma0, y, sigma, rho);
Posterior pi = posterior_independent(mu0, sigma0, y, sigma);
double ratio = pi.var / pc.var;
std::cout << "rho=" << rho << ":\n";
std::cout << " Correct correlated posterior: mean=" << pc.mean << ", var=" << pc.var << "\n";
std::cout << " Indep. assumption posterior: mean=" << pi.mean << ", var=" << pi.var << "\n";
std::cout << " Variance ratio (indep/correct) = " << ratio << " ( < 1 means overconfident )\n\n";
}
return 0;
}
7.3 Java (standalone; extensible to robotics middleware)
File: Chapter6_Lesson4.java
// Chapter6_Lesson4.java
// Independence Assumptions and Their Limits — correlated-sensor Bayesian fusion (Java)
//
// Demonstrates overconfidence when correlation is ignored.
//
// Libraries: none required (pure Java). For larger-scale robotics estimation,
// you would typically integrate with rosjava or Apache Commons Math.
// Compile:
// javac Chapter6_Lesson4.java
// Run:
// java Chapter6_Lesson4
public class Chapter6_Lesson4 {
static class Posterior {
public double mean;
public double var;
Posterior(double mean, double var) { this.mean = mean; this.var = var; }
}
// Inverse of Sigma = sigma^2 [[1,rho],[rho,1]]
static double[][] invSigma(double sigma, double rho) {
double s2 = sigma * sigma;
double det = s2 * s2 * (1.0 - rho * rho);
double[][] inv = new double[2][2];
inv[0][0] = s2 / det; // 1/(sigma^2*(1-rho^2))
inv[0][1] = -rho*s2 / det;
inv[1][0] = -rho*s2 / det;
inv[1][1] = s2 / det;
return inv;
}
static Posterior posteriorCorrelated(double mu0, double sigma0, double y1, double y2, double sigma, double rho) {
double[][] Sinv = invSigma(sigma, rho);
// H = [1,1]^T. info_meas = H^T Sinv H = sum of all entries of Sinv
double info_meas = Sinv[0][0] + Sinv[0][1] + Sinv[1][0] + Sinv[1][1];
double postVar = 1.0 / (1.0/(sigma0*sigma0) + info_meas);
// info_vec = H^T Sinv y
double info_vec = (Sinv[0][0] + Sinv[1][0]) * y1 + (Sinv[0][1] + Sinv[1][1]) * y2;
double postMean = postVar * (mu0/(sigma0*sigma0) + info_vec);
return new Posterior(postMean, postVar);
}
static Posterior posteriorIndependent(double mu0, double sigma0, double y1, double y2, double sigma) {
double postVar = 1.0 / (1.0/(sigma0*sigma0) + 2.0/(sigma*sigma));
double postMean = postVar * (mu0/(sigma0*sigma0) + (y1 + y2)/(sigma*sigma));
return new Posterior(postMean, postVar);
}
public static void main(String[] args) {
double mu0 = 0.0;
double sigma0 = 2.0;
double sigma = 1.0;
double y1 = 1.0, y2 = 1.2;
System.out.println(String.format("Prior: x ~ N(mu0, sigma0^2), mu0=%.6f, sigma0=%.6f", mu0, sigma0));
System.out.println(String.format("Measurements: y1=%.6f, y2=%.6f, sigma=%.6f\n", y1, y2, sigma));
double[] rhos = new double[] {0.0, 0.3, 0.6, 0.9};
for (double rho : rhos) {
Posterior pc = posteriorCorrelated(mu0, sigma0, y1, y2, sigma, rho);
Posterior pi = posteriorIndependent(mu0, sigma0, y1, y2, sigma);
double ratio = pi.var / pc.var;
System.out.println(String.format("rho=%.1f:", rho));
System.out.println(String.format(" Correct correlated posterior: mean=%.6f, var=%.6f", pc.mean, pc.var));
System.out.println(String.format(" Indep. assumption posterior: mean=%.6f, var=%.6f", pi.mean, pi.var));
System.out.println(String.format(" Variance ratio (indep/correct) = %.6f ( < 1 means overconfident )\n", ratio));
}
}
}
7.4 MATLAB / Simulink-oriented script
File: Chapter6_Lesson4.m
% Chapter6_Lesson4.m
% Independence Assumptions and Their Limits — correlated-sensor Bayesian fusion (MATLAB)
%
% Demonstrates overconfidence when correlation is ignored.
% Requires: base MATLAB. Optional: Robotics System Toolbox for later integration.
%
% Run:
% Chapter6_Lesson4
clear; clc;
mu0 = 0.0;
sigma0 = 2.0;
sigma = 1.0;
y = [1.0; 1.2];
fprintf('Prior: x ~ N(mu0, sigma0^2), mu0=%.6f, sigma0=%.6f\n', mu0, sigma0);
fprintf('Measurements: y1=%.6f, y2=%.6f, sigma=%.6f\n\n', y(1), y(2), sigma);
rhos = [0.0, 0.3, 0.6, 0.9];
for rho = rhos
[m_corr, v_corr] = posterior_correlated(mu0, sigma0, y, sigma, rho);
[m_ind, v_ind] = posterior_independent(mu0, sigma0, y, sigma);
ratio = v_ind / v_corr;
fprintf('rho=%.1f:\n', rho);
fprintf(' Correct correlated posterior: mean=%.6f, var=%.6f\n', m_corr, v_corr);
fprintf(' Indep. assumption posterior: mean=%.6f, var=%.6f\n', m_ind, v_ind);
fprintf(' Variance ratio (indep/correct) = %.6f ( < 1 means overconfident )\n\n', ratio);
end
% Optional visualization
try
rho_grid = linspace(0, 0.95, 25);
v_corrs = zeros(size(rho_grid));
v_inds = zeros(size(rho_grid));
for k = 1:numel(rho_grid)
[~, v_corrs(k)] = posterior_correlated(mu0, sigma0, y, sigma, rho_grid(k));
[~, v_inds(k)] = posterior_independent(mu0, sigma0, y, sigma);
end
figure;
plot(rho_grid, v_corrs, 'LineWidth', 1.5); hold on;
plot(rho_grid, v_inds, 'LineWidth', 1.5);
xlabel('Correlation \rho'); ylabel('Posterior variance');
title('Effect of ignoring correlation on posterior variance');
legend('Correct correlated', 'Assume independent (\rho=0)');
grid on;
catch ME
disp('Plot skipped:'); disp(ME.message);
end
% ---------- Local functions ----------
function [post_mean, post_var] = posterior_correlated(mu0, sigma0, y, sigma, rho)
Sigma = (sigma^2) * [1, rho; rho, 1];
Sinv = inv(Sigma);
H = [1; 1];
info_meas = H' * Sinv * H;
post_var = 1 / (1/(sigma0^2) + info_meas);
info_vec = H' * Sinv * y;
post_mean = post_var * (mu0/(sigma0^2) + info_vec);
end
function [post_mean, post_var] = posterior_independent(mu0, sigma0, y, sigma)
post_var = 1 / (1/(sigma0^2) + 2/(sigma^2));
post_mean = post_var * (mu0/(sigma0^2) + sum(y)/(sigma^2));
end
% ---------- Simulink note ----------
% To embed this in Simulink, you can create a MATLAB Function block "Fuse2Sensors"
% that implements posterior_independent or posterior_correlated, and feed it
% with y1,y2 constants (or from sensors). Programmatic construction uses:
% new_system('Ch6L4_IndepAssumptions'); open_system('Ch6L4_IndepAssumptions');
% add_block('simulink/Sources/Constant', ...); add_block('simulink/User-Defined Functions/MATLAB Function', ...);
% add_line(...); save_system(...);
7.5 Wolfram Mathematica (Notebook expression)
File: Chapter6_Lesson4.nb
(* Chapter6_Lesson4.nb
Independence Assumptions and Their Limits — correlated-sensor Bayesian fusion (Wolfram Language)
This is a plain-text notebook expression you can open in Mathematica.
*)
Notebook[{
Cell["Chapter 6, Lesson 4: Independence Assumptions and Their Limits", "Title"],
Cell["Correlated-sensor Bayesian fusion and overconfidence from assuming independence.", "Text"],
Cell[BoxData@ToBoxes[
Row[{"Prior: x ~ Normal(mu0, sigma0). Measurements: y = {y1,y2} = {x,x} + v, v ~ N(0, Sigma)."}]
], "Text"],
Cell[BoxData@ToBoxes[
HoldForm[
Sigma == sigma^2 { {1, rho}, {rho, 1} }
]
], "Input"],
Cell[BoxData@ToBoxes[
HoldForm[
(* Posterior precision: 1/sigma0^2 + [1,1] Sigma^{-1} [1;1] *)
infoMeas[sigma_, rho_] := ({1, 1}.Inverse[sigma^2 { {1, rho}, {rho, 1} }].{1, 1})
]
], "Input"],
Cell[BoxData@ToBoxes[
HoldForm[
postVar[mu0_, sigma0_, y1_, y2_, sigma_, rho_] := 1/(1/sigma0^2 + infoMeas[sigma, rho])
]
], "Input"],
Cell[BoxData@ToBoxes[
HoldForm[
postMean[mu0_, sigma0_, y1_, y2_, sigma_, rho_] := Module[
{Sinv, infoVec, v},
Sinv = Inverse[sigma^2 { {1, rho}, {rho, 1} }];
infoVec = {1, 1}.Sinv.{y1, y2};
v = postVar[mu0, sigma0, y1, y2, sigma, rho];
v*(mu0/sigma0^2 + infoVec)
]
]
], "Input"],
Cell["Demo", "Section"],
Cell[BoxData@ToBoxes[
HoldForm[
mu0 = 0; sigma0 = 2; sigma = 1; y1 = 1.0; y2 = 1.2;
Table[
{rho, postMean[mu0, sigma0, y1, y2, sigma, rho], postVar[mu0, sigma0, y1, y2, sigma, rho]},
{rho, {0.0, 0.3, 0.6, 0.9}}
] // TableForm
]
], "Input"],
Cell["Variance vs correlation", "Section"],
Cell[BoxData@ToBoxes[
HoldForm[
Plot[
Evaluate[postVar[mu0, sigma0, y1, y2, sigma, rho]],
{rho, 0, 0.95},
PlotRange -> All,
AxesLabel -> {"rho", "posterior variance"}
]
]
], "Input"]
}]
8. Problems and Solutions
Problem 1 (Derive the Bayes recursion): Starting from \( \text{bel}(x_t)=p(x_t\mid z_{1:t},u_{1:t}) \), derive the Bayes filter recursion and explicitly identify where Assumptions A and B are used.
Solution: This is exactly Theorem 1. The crucial steps are:
- Bayes rule: \( p(x_t\mid z_{1:t},u_{1:t}) \propto p(z_t\mid x_t,z_{1:t-1},u_{1:t})p(x_t\mid z_{1:t-1},u_{1:t}) \).
- Assumption B: \( p(z_t\mid x_t,z_{1:t-1},u_{1:t}) = p(z_t\mid x_t) \).
- Marginalization: \( p(x_t\mid z_{1:t-1},u_{1:t}) = \int p(x_t\mid x_{t-1},z_{1:t-1},u_{1:t})p(x_{t-1}\mid z_{1:t-1},u_{1:t})dx_{t-1} \).
- Assumption A and causality: \( p(x_t\mid x_{t-1},z_{1:t-1},u_{1:t}) = p(x_t\mid x_{t-1},u_t) \), and \( p(x_{t-1}\mid z_{1:t-1},u_{1:t}) = \text{bel}(x_{t-1}) \).
Problem 2 (Multi-sensor likelihood factorization): Let \( z_t = (z_t^{(1)},z_t^{(2)}) \). Assuming conditional independence given \( x_t \), show that the Bayes update can be written as two sequential updates that commute (order does not matter).
Solution: Under conditional independence:
\[ p(z_t \mid x_t) = p(z_t^{(1)}, z_t^{(2)} \mid x_t) = p(z_t^{(1)} \mid x_t)\,p(z_t^{(2)} \mid x_t). \]
The update is:
\[ \text{bel}(x_t) \propto p(z_t^{(1)} \mid x_t)\,p(z_t^{(2)} \mid x_t)\,\overline{\text{bel}}(x_t). \]
Define \( \text{bel}_1(x_t) \propto p(z_t^{(1)}\mid x_t)\overline{\text{bel}}(x_t) \). Then \( \text{bel}(x_t) \propto p(z_t^{(2)}\mid x_t)\text{bel}_1(x_t) \). Since multiplication is commutative, updating by \( z_t^{(1)} \) then \( z_t^{(2)} \) or the reverse yields the same belief (up to the same normalization).
Problem 3 (Quantify overconfidence): In the correlated Gaussian model of Section 4, derive the ratio \( R = \sigma_{\text{post,ind}}^2/\sigma_{\text{post,corr}}^2 \). Evaluate the weak-prior limit \( \sigma_0^2 \rightarrow \infty \).
Solution: From Section 4:
\[ \sigma_{\text{post,ind}}^2 = \left(\sigma_0^{-2} + \frac{2}{\sigma^2}\right)^{-1}, \qquad \sigma_{\text{post,corr}}^2 = \left(\sigma_0^{-2} + \frac{2}{\sigma^2(1+\rho)}\right)^{-1}. \]
Therefore
\[ R = \frac{\sigma_{\text{post,ind}}^2}{\sigma_{\text{post,corr}}^2} = \frac{\sigma_0^{-2} + \frac{2}{\sigma^2(1+\rho)}}{\sigma_0^{-2} + \frac{2}{\sigma^2}}. \]
If \( \sigma_0^2 \rightarrow \infty \) then \( \sigma_0^{-2} \rightarrow 0 \) and
\[ R \rightarrow \frac{\frac{2}{\sigma^2(1+\rho)}}{\frac{2}{\sigma^2}} = \frac{1}{1+\rho}. \]
For \( \rho > 0 \), \( R < 1 \), i.e., the independence approximation yields a smaller variance by the factor \( 1+\rho \) in the information-dominated regime.
Problem 4 (State augmentation for shared bias): Suppose a measurement has an additive bias \( b \) shared across time: \( z_t = h(x_t) + b + v_t \), with constant unknown \( b \). Explain why Assumption B fails if \( b \) is not in the state, then augment the state and write a valid measurement model.
Solution:
If \( b \) is unknown and constant, then observations share the same latent offset, making \( z_t \) statistically dependent on past observations even after conditioning on \( x_t \). Thus \( p(z_t \mid x_t, z_{1:t-1}) \neq p(z_t \mid x_t) \), violating Assumption B.
Augment the state as \( \tilde{x}_t = \begin{bmatrix}x_t \\ b_t\end{bmatrix} \) with \( b_t = b_{t-1} \) (or a slow random walk). Then the measurement model becomes:
\[ z_t = h(x_t) + b_t + v_t, \qquad p(z_t \mid \tilde{x}_t) = p(z_t \mid x_t, b_t), \]
restoring conditional independence given the augmented state.
Problem 5 (Discrete dependent sensors): Let \( x \in \{0,1\} \) with prior \( p(x=1)=0.5 \). Two binary sensors output \( z^{(1)}, z^{(2)} \in \{0,1\} \). Assume:
\[ p(z^{(1)}=1 \mid x=1)=0.9,\quad p(z^{(1)}=1 \mid x=0)=0.1, \]
and sensor 2 copies sensor 1 with probability 0.8 (shared pipeline), otherwise it behaves identically and independently. Compute \( p(x=1 \mid z^{(1)}=1, z^{(2)}=1) \) exactly, and compare to the naive independence product.
Solution:
Let \( C \) be the event “sensor 2 copies sensor 1,” with \( p(C)=0.8 \). Then:
\[ p(z^{(2)}=1 \mid z^{(1)}=1, x) = p(C)\cdot 1 + (1-p(C))\cdot p(z^{(2)}=1 \mid x) = 0.8 + 0.2\,p(z^{(2)}=1\mid x). \]
Since “otherwise it behaves identically,” take \( p(z^{(2)}=1\mid x=1)=0.9 \) and \( p(z^{(2)}=1\mid x=0)=0.1 \). Thus:
\[ p(z^{(1)}=1, z^{(2)}=1 \mid x=1) = p(z^{(1)}=1\mid x=1)\,p(z^{(2)}=1\mid z^{(1)}=1,x=1) = \\ 0.9\,(0.8+0.2\cdot 0.9)=0.9\cdot 0.98=0.882. \]
\[ p(z^{(1)}=1, z^{(2)}=1 \mid x=0) = 0.1\,(0.8+0.2\cdot 0.1)=0.1\cdot 0.82=0.082. \]
Bayes’ rule gives:
\[ p(x=1 \mid z^{(1)}=1,z^{(2)}=1) = \frac{0.882\cdot 0.5}{0.882\cdot 0.5 + 0.082\cdot 0.5} = \frac{0.882}{0.964} \approx 0.9149. \]
Under naive independence, one would use \( p(z^{(1)}=1,z^{(2)}=1\mid x=1) \approx 0.9\cdot 0.9=0.81 \) and \( p(\cdot\mid x=0) \approx 0.1\cdot 0.1=0.01 \), giving:
\[ p_{\text{ind}}(x=1 \mid 1,1) = \frac{0.81}{0.81+0.01} \approx 0.9878, \]
which is substantially more confident than the correct value because it double-counts nearly duplicated information.
9. Summary
We proved the Bayes-filter recursion by explicitly invoking (i) the first-order Markov property and (ii) measurement conditional independence. We then showed—analytically and computationally—that treating correlated measurements as independent produces overconfident beliefs via an inflated information term. Finally, we demonstrated how hidden biases and temporal correlations violate the Markov structure and how state augmentation restores it, providing a principled path from “broken assumptions” to a corrected probabilistic model.
10. References
- Kalman, R.E. (1960). A new approach to linear filtering and prediction problems. Journal of Basic Engineering, 82(1), 35–45.
- Smith, R.C., Self, M., & Cheeseman, P. (1990). Estimating uncertain spatial relationships in robotics. Autonomous Robot Vehicles (Springer), 167–193.
- Durrant-Whyte, H.F. (1988). Sensor models and multisensor integration. The International Journal of Robotics Research, 7(6), 97–113.
- Julier, S.J., & Uhlmann, J.K. (1997). A non-divergent estimation algorithm in the presence of unknown correlations. Proceedings of the American Control Conference, 2369–2373.
- Maybeck, P.S. (1979). Stochastic Models, Estimation, and Control, Vol. 1. Academic Press (foundational treatment of correlated noises and state augmentation).
- Bar-Shalom, Y., Li, X.R., & Kirubarajan, T. (2001). Estimation with Applications to Tracking and Navigation. Wiley (rigorous discussion of correlation and fusion).
- Fox, D. (2003). Adapting the sample size in particle filters through KLD-sampling. The International Journal of Robotics Research, 22(12), 985–1003.
- Thrun, S., Burgard, W., & Fox, D. (2005). Probabilistic Robotics. MIT Press (canonical reference; includes conditional independence assumptions in Bayes filtering).