A robot estimate at 100 mm and a new observation at 106 mm do not automatically combine into 103 mm. A scalar Kalman measurement update weights their contributions according to a declared uncertainty model.
The resulting number depends on the prior variance, measurement-noise variance, and measurement relationship. Calling the operation sensor fusion does not supply those quantities or establish that the model is correct.
FilterPy's documentation distinguishes prior state covariance, measurement noise, the measurement function, and the update. Its published implementation shows the innovation, Kalman gain, mean correction, and covariance calculation. The scalar example here is original analytic work; no library, estimator, or robot was executed.
Define one state and one observation
Let x be an unknown position in millimeters at one declared instant. Model the prior distribution of x as Gaussian with mean mu and variance P, where P is strictly positive.
Let a new observation be z = x + v. Model v as zero-mean Gaussian noise with variance R, strictly positive and independent of x under the prior model. The measurement scale is one, so the observation directly measures the modeled position coordinate.
This is one measurement update. The example does not estimate velocity, propagate motion, compensate sensor bias, or infer a three-dimensional pose. Those additions require a larger state and further assumptions.
P and R have units of mm². Their square roots have units of millimeters. Confusing standard deviations with variances changes the gain even when all displayed position values remain unchanged.
Combine the two quadratic terms
Under these assumptions, multiplying prior density by measurement likelihood gives a posterior density proportional to:
exp{−one-half[(x − mu)²/P + (z − x)²/R]}.
Collecting the x² and x terms and completing the square gives:
P_post = 1/(1/P + 1/R),
mu_post = P_post(mu/P + z/R).
The reciprocal variances add because the model has independent Gaussian information about the same scalar. This is a consequence of the stated probability model, not a general rule for adding arbitrary confidence scores.
The same equations can be written with gain K = P/(P + R), innovation y = z − mu, and mu_post = mu + Ky. The posterior variance is PR/(P + R), also equal to (1 − K)P for this optimal scalar gain in exact arithmetic.
Choose an original numerical case
Set mu = 100 mm and P = 9 mm², corresponding to a prior standard deviation of 3 mm. Let z = 106 mm and R = 16 mm², corresponding to measurement-noise standard deviation 4 mm.
The innovation is 6 mm. The gain is 9/(9 + 16) = 0.36. The corrected mean is therefore 100 + 0.36 × 6 = 102.16 mm.
The posterior variance is 9 × 16/25 = 5.76 mm² and its standard deviation is 2.4 mm. The updated mean moves 36 percent of the way from the prior mean toward the observation.
An equal-weight mean of 103 mm would correspond to K = 0.5, rather than the gain established by these variances. The distinction is not caused by a new position unit or a different innovation; it comes from the relative uncertainty assumptions.
Change the measurement model, not the observed value
Keep mu, P, and z unchanged but choose a separate hypothetical measurement variance R = 4 mm². The measurement standard deviation is now 2 mm.
The gain becomes 9/13, approximately 0.692308. The posterior mean is approximately 104.153846 mm, while posterior variance is 36/13, approximately 2.769231 mm².
The observation receives more weight because the newly declared model treats it as more precise. This comparison does not show that changing a software parameter improved a sensor. It shows what the estimator assumes when that parameter changes.
With positive P and R, K lies between zero and one and the updated mean lies between mu and z. As R becomes very large, the correction becomes small. As R approaches zero, the gain approaches one. Those are mathematical limits of this model, not instructions to assign zero noise to hardware.
The covariance formula is a model result
Return to P = 9 and R = 16. If the observation were 94 mm instead, the mean would become 97.84 mm. The posterior variance would still be 5.76 mm².
Under fixed linear Gaussian assumptions, that variance depends on P and R rather than the realized innovation's sign or magnitude. A surprisingly distant observation does not automatically cause this formula to increase the reported uncertainty.
This is an important interpretation limit. A numerical covariance can shrink while a biased, incorrectly associated, or otherwise mismodeled observation moves the estimate away from the true position. Model-based uncertainty is not an independent certificate of actual error.
FilterPy's published update computes the covariance in the expanded form (1 − K)²P + K²R for the scalar identity-measurement case. Substituting 0.36 gives 0.4096 × 9 + 0.1296 × 16 = 5.76 mm², agreeing with the simplified result here. The implementation's numerical-stability motivation is separate from the exact-arithmetic derivation.
Keep units consistent through the update
Express the first case in meters instead. The mean is 0.100 m, observation 0.106 m, prior variance 0.000009 m², and measurement variance 0.000016 m².
Both variances scale by the same factor of one millionth, so K remains 0.36. The posterior mean is 0.10216 m and variance 0.00000576 m², representing the same result.
Converting the position values while leaving numerical variances in mm² would break that consistency. Retaining a unit beside each covariance quantity prevents a superficially valid formula from representing a different problem.
A prior must not silently reuse the new observation
The independence assumption is substantive. If the prior already incorporates the very same observation, applying this update again as if it were new independent information changes the model without supplying a new measurement.
Similarly, a shared unknown bias or correlated noise needs an appropriate representation. Neither the scalar gain nor the number of decimal places establishes independence.
For a robot estimate, the useful account retains the prior's meaning, observation identity, measurement function, variances and units, and assumptions about their relationship. The update can then be reproduced as a conditional estimate under a clear model, while its narrower uncertainty claim remains visible.
Sources checked October 23, 2026: FilterPy, KalmanFilter API documentation displayed as version 1.4.4, prior/covariance/noise attributes and update: https://filterpy.readthedocs.io/en/latest/kalman/KalmanFilter.html
FilterPy, published kalman_filter module source, same displayed documentation edition, update equations and expanded covariance calculation: https://filterpy.readthedocs.io/en/latest/_modules/filterpy/kalman/kalman_filter.html
Illustration note: A generic robot monitoring or computer image is a concept illustration. It does not show the invented measurements, a deployed filter, or measured estimation accuracy.