Uncertainty sources
Quick answer
Predictive uncertainty describes how much we do not know about a future outcome. Aleatoric uncertainty refers to outcome variability given the modeled inputs. Epistemic uncertainty concerns incomplete knowledge of the model or its parameters. Examples are static Python snippets tested locally on CPU; Native detector examples require NumPy and scikit-learn; exercises use standard-library Python. ByteMind execution is unverified.
Mixture variance decomposition
from statistics import mean,pvariancemu=[2,6];v=[1,3]print(mean(mu),mean(v),pvariance(mu),mean(v)+pvariance(mu))Expected output (locally tested): 4 2 4 6. Within and between variances add for this equally weighted mixture.
How it works
If several models predict a conditional mean mu_m and conditional variance sigma_m^2, the law of total variance gives Var(Y|x)=E_m[sigma_m^2]+Var_m(mu_m), for a specified mixture over models. The first term is average within-model variance; the second is between-model variance. Example: means 2 and 6 with equal weight and within variances 1 and 3 give predictive mean 4 and total variance 2+4=6. This is an exact mixture calculation, not proof that an arbitrary ensemble separates all uncertainty sources. A deterministic model with no variance output cannot estimate within-model uncertainty from its predictions alone. Ensembles, bootstrap models and approximate Bayesian methods can reveal sensitivity to model assumptions, but shared biases may produce confident errors. Repeated sensor measurements in stable conditions can help estimate noise; data collection in poorly represented regimes can reduce some epistemic uncertainty. Distribution shift may invalidate both estimates. Predictive intervals for individual outcomes differ from confidence intervals for a mean or parameter. Use uncertainty for a review or abstention policy with coverage and error trade-offs; never equate a narrow interval with guaranteed correctness. Track uncertainty separately by operating regime, sample count and time.
Shared bias despite agreement
pred=[5,5,5];actual=10from statistics import pvarianceprint(pvariance(pred),abs(actual-pred[0]))Expected output (locally tested): 0 5. Agreement alone does not establish accuracy.
Common mistakes
Do not sum standard deviations, treat ensemble disagreement as complete uncertainty, or claim that more data removes inherent measurement noise.
Practice and next steps
Compute total mixture variance for means [1,3,5], all within variances equal to 2. Then add the same constant to each mean and verify that variance is unchanged.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Uncertainty sources — knowledge check
Apply uncertainty sources to small examples and debugging scenarios.
Which uncertainty concerns irreducible variability given inputs?
What does epistemic uncertainty concern?
What adds in the mixture variance identity?
Does zero ensemble disagreement prove accuracy?
What does a prediction interval target?