Reference notes.

Probability theory provides the mathematical foundation for quantifying uncertainty. Statistics uses data to make inferences about the world. Together, they form the backbone of data science, machine learning, and scientific research.

Probability Foundations

Sample Spaces and Events

A sample space is the set of all possible outcomes of an experiment.

  • Events are subsets of the sample space
  • Complement:
  • Union:
  • Intersection:

Probability Axioms (Kolmogorov)

  1. Non-negativity: for any event
  2. Normalisation:
  3. Countable additivity: For any countable sequence of pairwise disjoint events ,

From these axioms, we derive:

Conditional Probability

The probability of given that has occurred:

Independence: Two events are independent if and only if:

Bayes’ Theorem

For (and ):

This allows us to update our beliefs about after observing evidence .

Law of Total Probability

For a partition of with for each :

Random Variables

A random variable is a function that assigns a numerical value to each outcome.

Discrete Random Variables

Takes countably many values.

  • Probability mass function (PMF):
  • Cumulative distribution function (CDF):

Properties of a PMF:

  • for all

Continuous Random Variables

An (absolutely) continuous random variable is characterised by a non-negative probability density function (PDF) whose integral gives its continuous CDF:

  • PDF: such that
  • CDF:

Properties of a PDF:

  • for all
  • for any specific value

Expected Value

The expected value (mean) is the probability-weighted average of all possible values (provided the sum/integral converges absolutely, i.e. ).

Discrete:

Continuous:

Properties (when the expectations exist and are finite):

  • Linearity:
  • for any constant
  • Law of the unconscious statistician: or

Variance and Standard Deviation

Variance measures the spread of a distribution around its mean (when ):

Standard deviation:

Properties (for finite variances):

  • For independent :

Covariance and Correlation

Covariance measures how two variables with finite variances vary together:

Correlation is the normalised covariance (defined when ):

Common Distributions

Discrete Distributions

DistributionParameters & SupportPMFUse Case
, Single trial
, Successes in trials
, Count of rare events
, Trials until first success
, Trials until successes

Continuous Distributions

DistributionParameters & SupportPDFUse Case
, Equal likelihood
, Wait times, memoryless
, Natural phenomena
(rate), Sum of exponentials
, Probabilities

The Normal Distribution

The normal (Gaussian) distribution is ubiquitous due to the Central Limit Theorem.

Standard normal:

Standardisation: If , then

68-95-99.7 Rule:

  • of values fall within of
  • of values fall within of
  • of values fall within of

Limit Theorems

Law of Large Numbers (LLN)

For i.i.d. random variables with finite mean and , as the sample mean converges to :

(The finite-mean assumption is essential: the LLN fails for distributions without a mean, such as the Cauchy distribution.)

Central Limit Theorem (CLT)

For i.i.d. random variables with mean and finite positive variance :

The sum or average of many independent random variables is approximately normal, regardless of the underlying distribution.

Statistical Inference

Point Estimation

Estimating a single value for a population parameter.

  • Sample mean: estimates
  • Sample variance: (for ) is an unbiased estimator of
  • Maximum Likelihood Estimation (MLE): Find that maximises the likelihood
  • Method of Moments: Equate sample moments to population moments

Desirable properties: Unbiasedness, consistency, efficiency

Interval Estimation

A confidence interval provides a range of plausible values.

  • 95% CI for (known ): (exact for normal data; approximately valid for large by the CLT)
  • 95% CI for (unknown ): (exact for i.i.d. normal data; approximately valid for large )

Interpretation: If we repeated the experiment many times, of the constructed intervals would contain the true parameter.

Hypothesis Testing

  1. State null hypothesis and alternative
  2. Choose significance level (typically )
  3. Calculate test statistic from data
  4. Find -value or critical region
  5. Reject if

Errors:

  • Type I error (probability ): Probability of rejecting when is true (false positive)
  • Type II error (probability ): Probability of failing to reject when is false (false negative)
  • Power : Probability of correctly rejecting a false

Common Statistical Tests

TestPurposeAssumptions
One-sample -testCompare mean to a valueIndependence, normality (or large )
Two-sample -testCompare two meansIndependence, normality (Student’s assumes equal variances; Welch’s does not)
Paired -testCompare paired observationsIndependent pairs, normality of differences
testTest categorical associations / goodness of fitIndependence, expected counts
-testCompare variancesIndependence, normality
ANOVACompare multiple meansIndependence, normality, equal variances

Bayesian Statistics

The Bayesian Approach

  • Prior : Initial belief about the parameter
  • Likelihood : Probability (or probability density) of the data given the parameter, viewed as a function of
  • Posterior : Updated belief after observing data
  • Evidence : Normalising constant ( or )

(For discrete models denotes probability mass functions; for continuous models denotes probability density functions.)

Bayesian vs Frequentist

AspectFrequentistBayesian
ProbabilityLong-run frequencyDegree of belief
ParametersFixed unknown constantsRandom variables
Prior informationNot formally usedExplicitly incorporated
InferencePoint estimates, CIsPosterior distribution
InterpretationObjectiveSubjective/epistemic

Regression

Simple Linear Regression

Models the relationship between two variables:

Least squares estimates (using sample covariance and variance, with ):

Coefficient of determination: measures the proportion of variance explained (valid as a proportion in when the model includes an intercept).

Multiple Linear Regression

In matrix form:

Least squares solution (when is invertible, i.e. has full column rank):

Assumptions: Linearity, zero conditional mean (), independence, homoscedasticity, full column rank of , and (for exact small-sample inference) normality of errors.

Multicollinearity: When predictors are highly correlated, is nearly singular and estimates become unstable.

Learning Resources

Books

  • A First Course in Probability by Sheldon Ross
  • Statistical Inference by Casella and Berger
  • All of Statistics by Larry Wasserman
  • Probability Theory: The Logic of Science by E.T. Jaynes

Online Courses