






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Probability & Statistics Primer Gregory J. Hakim University of Washington 2 January 2009 v2.
This primer provides an overview of basic concepts and definitions in probability and
statistics. We shall denote a sample space by S, and define a random variable by the re-
sult of a rule (function) that associates a real number with each outcome in S. For simplicity,
consider two discrete random variables that are associated with events in the sample space, A
and B. The probability of A, denoted by P (A), can be viewed as the frequency of occurrence
of the event (the “frequentist perspective”). Equivalently, P (A) represents the likelihood of
the event occurring; this is called the “Bayesian perspective,” which will prove useful for
interpreting conditional probability. There are three basic probability axioms. Probability
axiom #1 states that P (A) is a real number between 0 and 1. The complement of A, Ac, is
defined as all events in S that are not in A; P (A) = 1 − P (Ac). A familiar example derives
from rolling a one on an unbiased six-side die, which occurs with probability 1/6. We can
check this by rolling the die many times, counting the number of ones, and dividing by the
number of rolls. “Probability axiom #2” says that P (S) = 1. “Probability axiom #3” will
be defined below, but basically it says that if we have n outcomes that don’t overlap, the
probability of all of them occurring is just the sum of the probabilities for each outcome.
For discrete random variables, we shall use probability mass functions (PMFs). PMFs
return a probability for the discrete random variable, X. For the unbiased six-side die
P (X = 6) = 1/6, etc. For continuous variables, we shall use probability density functions
(PDFs), denoted by p(x). A PDF is related to a probability through an integral relationship,
which is unity over the whole sample space. For example, in one dimension,
P (−∞ < x < ∞) =
−∞
p(x) dx = 1. (1)
The probability that x is between a and a + da is
P (a ≤ x ≤ a + da) =
∫ (^) a+da
a
p(x) dx ≈ P (a) da (2)
Note that P (a ≤ x ≤ a+da) may be a very small number even at the “peak” of a distribution
if da is small; however, it will be larger than all others for similarly chosen da and different
x. Furthermore, it doesn’t really make sense to say that, “the probability of x = a is P(a)”
because as (2) shows, this limiting case gives
P (x = a) =
∫ (^) a
a
p(x) dx = 0. (3)
Union and Intersection
Sample space (S): the set of all possible outcomes. Example: the sample space for a
six-sided die consists of the integer values 1,2,3,4,5, and 6. P (S) = 1.
Figure 1: Venn diagrams for (left) mutually exclusive events (center) intersection or probability of A and B [P (A ∩ B)] and (right) union or probability of A or B [P (A ∪ B)].
Mutually exclusive events: A and B share no common outcomes (Fig. 1, left panel).
Intersection P (A ∩ B), “A and B”: outcome is both A and B (Fig. 1, center panel). If A and B are mutually exclusive, then P (A ∩ B) = 0. The intersection is commutative, P (A ∩ B) = P (B ∩ A), and associative, P (A ∩ B ∩ C) = P ([A ∩ B] ∩ C) = P (A ∩ [B ∩ C]).
Union P (A∪B), “A or B”: outcome is either A or B. From the Venn diagram in Fig. 1 (right panel) we can see that the probability of A or B is the sum of the individual probabilities, minus the intersection, which gets added twice:
P (A ∪ B) = P (A) + P (B) − P (A ∩ B). (4)
If A and B are mutually exclusive, then P (A∪B) = P (A)+P (B); i.e. sum the probabilities. The union is commutative, P (A ∪ B) = P (B ∪ A), and associative, P (A ∪ B ∪ C) = P ([A ∪ B] ∪ C) = P (A ∪ [B ∪ C]).
NOTE: Union and intersection are not associative: P ([A ∪ B] ∩ C) 6 = P (A ∪ [B ∩ C]), but they do satisfy the distributive property: P (A ∪ [B ∩ C]) = P ([A ∪ B] ∩ [A ∪ C]) and P (A ∩ [B ∪ C]) = P ([A ∩ B] ∪ [A ∩ C]).
Figure 2: Probability of A and B and C [ P (A ∩ B ∩ C) = P (A, B, C)].
More generally, the chain rule of conditional probability allows one to “factor” joint prob- abilities. Previously we discussed the “product rule” for two variables,
P (A, B) = P (A | B)P (B) = P (B | A)P (A), (12)
and a similar result for three variables,
P (A, B, C) = P (A | B, C)P (B, C) = P (A | B, C)P (B | C)P (C). (13)
Extending to n variables,
P (A 1 , A 2 ,... , An) = P (A 1 | A 2 ,... , An)P (A 2 | A 3 ,... , An) · · · P (An− 1 | An)P (An). (14)
A Markov Chain, denoted A → B → C, is defined by a joint probability that factors as P (A, B, C) = P (C | B)P (B | A)P (A), which implies that C is independent of A. If A, B, C occur sequentially in time (as implied by the arrows in the definition), this means that in order to determine the probability at the new time, C, we only need to know the probability of the current time, B.
Marginal probability
Marginal probability represents the unconditional probability of one or more independent random variables without considering information from other random variables; e.g. consider P (A) instead of P (A, B). For discrete random variables, we obtain P (A) from P (A, B) by summation over the unwanted variable in the joint probability mass function:∑ P (A) =
B
B
P (A | B)P (B). Similarly, for continuous random variables, marginal
probability density functions are defined by integrating over the unwanted variables in the
joint probability density function; e.g., p(y) =
y
p(x, y)dy =
y
p(x | y)p(y)dy.
Likelihood
With conditional probability, we are given specific information about an event that affects the probability of another event; e.g., knowing that B = b allows us to “update” the probability of A by P (A | B = b) through (7). Conversely, if we view the conditional probability as a function of the second argument, B, we get a likelihood function,
L(b | A) = αP (A | B = b), (15)
where α is a constant parameter. For example, consider a sequence of observations of a two-sided coin with outcomes “H” and “T.” If we flip the coin once and observe “H” we can ask, “what is the likelihood that the true probability, P (H) is 0.5?” Fig. 3 (left panel) shows that L = 0.5, and in fact the most likely value is P(H) = 1; note that L(0) = 0 since “H” has been observed and therefore must have a nonzero probability. Suppose flipping the coin again also gives “H.” Maximum likelihood is still located at P (H) = 1, and the likelihood of smaller P (H) is diminished. Remember, that we can turn this around and ask, if we know that P (H) = 0.5 (i.e., the coin is fair), what is the probability of observing “HH?” This is conditional probability, which in this case is 0.25 (the same as L(0. 5 | “HH′′). Observing “HHH” gives a cubic function for L, and so one. If, on the other hand, one of the observations is also “T,” then both L(0) and L(1) must be zero (Fig. 3; right panel).
Figure 3: Likelihood as a function of the probability of “H” on a two-sided coin. On the left, the first three trials give only “H,” whereas on the right “T” is observed as well.
Note that, unlike conditional probability, likelihood is not a probability, since it may take values larger than unity, and does not integrate to one.
Independence. Events A and B are independent if the outcome of one does not depend on the outcome of the other; i.e.
P (A | B) = P (A). (16)
The kth^ moment about the expected value is defined by
μk =
−∞
(x − μ)k^ p(x) dx, (23)
where μ = E[x]. Note that the first moment is zero, and that the second moment is called the variance, and is usually denoted by σ^2 ; the standard deviation is defined as the square-root of the variance, σ.
The covariance between two random variables is defined by
cov(x, y) = E[(x − μ)(y − ν)] = E[xy] − μν, (24)
where μ and ν are E[x] and E[y], respectively. The covariance determines the linear relationship between two quantities, and the strength of this relationship is measured by the correlation coefficient,
corr(x, y) = cov(x, y) σxσy
which ranges between −1 and +1. If x and y are independent, then cov(x, y) = corr(x, y) =
Note that these definitions for PDFs extend naturally to multidimensional settings, and also to discrete random variables; in the discrete case, integrals are replace by sums.
Gaussian (Normal) Probability Density Function
Although there are many analytically defined PDFs, the Gaussian is particularly important in many areas of science. The assumption of Gaussian statistics is often invoked because it greatly simplifies the analysis, since all moments (23) of the PDF may be determined from the mean and covariance. A theoretical underpinning for this widespread use of the Gaussian PDF is given by the Central Limit Theorem, which states that the sum of many independent, identically distributed random variables is normally distributed (i.e., the mean value approaches nμ and the variance approaches nσ^2 for sufficiently large n); note that “identically distributed” means “have the same distribution.”
In one dimension, the Gaussian (Normal) distribution is defined by
p(x) = (2π)−^1 /^2 (σ)−^1 e−^
12 (x− σμ 2 )^2 , (26)
where μ is the expected value and σ^2 is the variance. A shorthand notation to denote a variable having a Gaussian distribution is x ∼ N (μ, σ^2 ).
Properties of the Gaussian include:
Multivariate PDFs and Conditional Probability
Set union discussed on page 2 for discrete variables generalizes to joint probability density functions for continuous random variables, p(x). For example, the n-dimensional generaliza- tion of the Gaussian distribution is
p(x) = (2π)−n/^2 (| B |)−^1 /^2 e−^12 (x−μ)T^ B−^1 (x−μ), (27)
where x are μ are vectors and B is the covariance matrix. The vector x has one entry for each of the n degrees of freedom, as does μ, which represents the vector of expected values. The covariance matrix, real and symmetric, is defined by B = E[(x − μ)(x − μ)T^ ], and | · | is the determinant. Diagonal elements of B represent the variance in each degree of freedom, and the off-diagonal elements represent cov(xi, xj ); in the case where all degrees of freedom are independent, B is diagonal. The superscripted “T” denotes the transpose. In the limiting case of n = 1, (27) recovers (26). Each property of the one-dimensional Gaussian has a multi-dimensional extension. One useful example is the linear transformation of the n × 1 Gaussian random vector, x ∼ N (μ, B), by the m × n matrix operator, A,
Y = Ax, (28)
where Y ∼ N (Aμ, ABAT).
The generalization of Bayes Theorem to multivariate continuous random variables is given by
p(x|y) =
f (x, y) f (y) =^
p(y|x) p(x) p(y).^ (29) Equivalently, using the definition for joint probability, (29) may be expressed as
p(x|y) = p( px(y,^ y) ). (30)
To help illustrate conditional probability, consider a two-dimensional example for Gaussian variables x and y having zero mean, correlation ρ, and standard deviation σx and σy,