Statistics
Samples, estimation, inference, and testing
This appendix outlines the statistical foundations and terminology assumed throughout these notes. It points to the definitions, worked calculations, and examples in the lab’s shared prerequisite site: Statistics for Data Science.
Machine learning and statistics share much of their mathematical foundations, but often differ in their primary goals: statistics emphasizes inference, parameter estimation, and hypothesis testing, whereas machine learning emphasizes generalization and predictive accuracy on unseen data [1], [2].
Statistical theory explains what conclusions a finite sample of data supports, how to estimate underlying model parameters, and how to measure uncertainty. This appendix outlines the core concepts and links directly to their full definitions in Statistics for Data Science.
1 Populations, samples, and empirical distributions
Statistics for Data Science covers the distinction between populations and finite samples:
- Populations and samples: A population distribution describes the entire data-generating process, while a sample consists of \(N\) observed data points drawn from that population.
- Independent and identically distributed (i.i.d.) observations: Sampling data independently from a shared underlying distribution \(p(\vx, y)\).
- Empirical distributions: Placing probability mass \(1/N\) on each observed training instance, which forms the basis for empirical risk minimization [3].
- Standardization and min-max scaling: Centering features to mean zero and scaling to unit variance (z-scores), or scaling to a fixed interval \([0, 1]\).
Starmer explains data scaling and normalization [4].
GeeksforGeeks explains:
2 Point estimation and estimator properties
Statistics for Data Science covers parameter estimation and estimator performance:
- Point estimators: A rule or statistic \(\hparam = g(X_1, \ldots, X_N)\) used to estimate an unknown population parameter \(\param\) [7].
- Estimator bias: \(\mathrm{Bias}(\hparam) \triangleq \Ep[\hparam] - \param\). An estimator is unbiased when \(\mathrm{Bias}(\hparam) = 0\) [8].
- Estimator variance and standard error: \(\Var{\hparam} = \Ep\sb{(\hparam - \Ep[\hparam])^2}\), with standard error \(\mathrm{SE}(\hparam) \triangleq \sqrt{\Var{\hparam}}\).
- Mean squared error (MSE) and the bias-variance decomposition of an estimator: \(\pMSE{\hparam} \triangleq \Ep\sb{(\hparam - \param)^2} = \mathrm{Bias}(\hparam)^2 + \Var{\hparam}\).
- Maximum likelihood estimation (MLE): Estimating parameters by maximizing the likelihood function \(L(\param; \vx) = \prod_{i=1}^N p(x_i; \param)\), or equivalently the log-likelihood \(\llik(\param; \vx) = \sumiN \ln p(x_i; \param)\).
Starmer explains:
GeeksforGeeks explains:
5MinuteAI explains:
- maximum likelihood estimation, with examples
- properties of estimators (the first of three videos)
Both come from its Probability & Statistics playlist [13].
The University of Washington’s CSE 446 slides cover maximum likelihood estimation [14], Lecture 2.
3 Hypothesis testing and confidence intervals
Statistics for Data Science covers formal hypothesis testing and uncertainty quantification:
- Null hypothesis (\(H_0\), the default baseline or null effect) versus alternative hypothesis (\(H_1\), the alternative claim).
- Test statistics and \(p\)-values: A test statistic summarizes sample evidence, and the \(p\)-value is the probability under \(H_0\) of observing a test statistic at least as extreme as the one calculated.
- Significance levels and decision errors: A test with significance level \(\siglevel\) rejects \(H_0\) when the \(p\)-value is at most \(\siglevel\). A Type I error (false positive) occurs when rejecting a true \(H_0\); a Type II error (false negative) occurs when failing to reject a false \(H_0\), with statistical power defined as \(1 - \typetwoerr\).
- Confidence intervals: Constructing an interval \([L, U]\) that covers the true parameter \(\param\) with probability \(1 - \siglevel\) under repeated sampling [15].
5MinuteAI explains confidence intervals and hypothesis testing [13].
GeeksforGeeks explains:
4 Statistical inference versus machine learning prediction
Machine learning and statistics share data and mathematical tools, but often approach modeling from different perspectives:
- Inference: Focuses on understanding the data-generating mechanism, estimating interpretable parameters, quantifying uncertainty via standard errors and confidence intervals, and testing specific scientific hypotheses.
- Prediction: Focuses on constructing models that generalize accurately to new, unseen observations, often accepting complex, regularized, or non-parametric models where individual parameters may not have a simple mechanistic interpretation.
- Course Overview discusses the relationship between machine learning and statistics in detail, and provides a translation table between the vocabularies of both fields.
- Historical and cultural roots: The divergence in terminology and modeling philosophy is surveyed in classic papers by Breiman [18] on the algorithmic and data modeling cultures, Ripley [19], Table 1.1 on parallel terms across neural networks and statistics, Varian [20] comparing machine learning and econometrics, and Efron and Hastie [21] on computer age statistical inference.