Accessible version · How to use this site with a screen reader · Course home
Day 1 Morning · Accessible lecture notes

Introduction to probability

A screen-reader-friendly transcript of the lecture slides: all slide text, tables, figure descriptions, and speaker notes.

About these notes

Each section is one slide. Figures carry text descriptions where available. For the concepts with worked examples, also read the plain-language summary and lab for this session.

Slide 1: FW536 – Statistical modeling for ecology and conservation AKA Get your data on!

(No text on this slide.)

Slide 2: What is this course?

Goal: Provide a strong statistical foundation and transferable skills to help you (1) understand and analyze data, and (2) conduct more complex statistical modeling

We are going for deep understanding not just implementing R code.

Slide 3: Course oath

Slide 4: Grading

Slide 5: This course is just a jumping off point

Figure 5.1. Book cover: The Ecological Detective, Confronting Models with Data, by Ray Hilborn and Marc Mangel.
Figure 5.2. Book cover: Ecological Models and Data in R by Benjamin M. Bolker, showing a fish over coral.
Figure 5.3. Book cover: The Theoretical Biologist's Toolbox, Quantitative Methods for Ecology and Evolutionary Biology, by Marc Mangel.
Figure 5.4. Book cover: Applied Hierarchical Modeling in Ecology, Volume 1, by Marc Kery and J. Andrew Royle, with a green dragonfly.
Figure 5.5. Book cover: Applied Hierarchical Modeling in Ecology, Volume 2, by Marc Kery and J. Andrew Royle, with a red dragonfly.
Figure 5.6. Book cover: Bayesian Models, A Statistical Primer for Ecologists, by N. Thompson Hobbs and Mevin B. Hooten.

Slide 6

GLM: the superset of all stuff you learned

Figure 6.1. Book cover: The French Chef Cookbook by Julia Child; used as a joke about learning recipes versus understanding.

Slide 7

GLM: the superset of almost all stuff you learned

Speaker notes for this slide

Paired - Count macroinvertebrates in a stream before and after a restoration intervention.

Slide 8

Figure 8.1. Reference chart titled 'Common statistical tests are linear models', tabulating each test (t-tests, ANOVA, ANCOVA, correlation, chi-square) with its R function and equivalent lm() linear-model formula. Takeaway: familiar tests are special cases of linear models.

Slide 9

This can be generalized further

Figure 9.1. Diagram of statistical model relationships: general linear models at top branch via nonlinearity, random effects, and non-normal errors into mixed models, GLMs, GLMMs, GAMs, and nonlinear time series. Shows how model families connect.

Slide 10

Slide 11: Probability Experiments

A probability experiment is a process or action that can be repeated under the same conditions and results in well-defined outcomes, but the outcome is uncertain or random. Each possible outcome of the experiment has an associated probability, which is a measure of how likely that outcome is to occur.

Slide 12: Probability Experiments

Probability ExperimentCount of the number of trees in a stand
Sample Space (all possible outcomes){0, 1, 2, ….}
Event (subset of interest from sample space)>10
Outcome (the actual result in the probability experiment)5

Slide 13: Probability Experiments

Probability ExperimentDetermine the maturity state of a baleen whale
Sample SpaceMature, Calf, Juvenile
EventImmature = {Juvenile OR Calf}
OutcomeCalf

Slide 14: Classical Probability

Figure 14.1. Diagram: a large outer region labeled S (sample space) containing two small overlapping regions A and B, with their overlap shaded. Illustrates events as subsets of the sample space.
Figure 14.2. Book cover: The Theoretical Biologist's Toolbox by Marc Mangel.

In probability theory, we are concerned with outcomes of “experiments,” broadly defined. We let S be all the possible outcomes (often called the sample space) and A, B, etc., particular outcomes that might interest us (Figure 3.1a). We then define the probability that A occurs, denoted by Pr{A}, by

Pr{A} = (Area of A) / (Area of S) (3.1)

Slide 15: Classical Probability-II (Example)

Slide 16: DNA Example

Slide 17: DNA Example

Slide 18: DNA Example

Slide 19: Probabilities Formalized

Why “1” here?

0 ≤ P(E) ≤ 1

P(E') = 1 − P(E)

Slide 20: Example

How would this be different if the population wasn’t large?

Slide 21: Conditional Probability-I

Slide 22: Conditional Probability-II

Gene PresentGene Not PresentTotal
Spring Run331952
Fall Run391150
Total7230102
Figure 22.1. Photo: a red-bodied spawning Chinook salmon swimming over a gravel streambed, with other salmon behind.

Slide 23: Conditional Probability-III

Gene PresentGene Not PresentTotal
Spring Run331952
Fall Run391150
Total7230102
Figure 23.1. Photo: a red-bodied spawning Chinook salmon over a gravel streambed.

Slide 24: Conditional Probability-IV

Gene PresentGene Not PresentTotal
Spring Run331952
Fall Run391150
Total7230102
Figure 24.1. Photo: a red-bodied spawning Chinook salmon over a gravel streambed.

Slide 25: Conditional Probability-V

Figure 25.1. Diagram: sample space S containing two overlapping events A and B with the overlap shaded, used to illustrate conditional probability.

Mangel’s Toolbox

Now suppose we are told that B has occurred. We may then ask, what is the probability that A has also occurred? The answer to this question is called the conditional probability of A given B and is denoted by Pr{A|B}. If we know that B has occurred, the collection of all possible outcomes is no longer S, but is B. Applying the definition in Eq. (3.1) to this situation (Figure 3.1a) we must have

Pr{A|B} = (Area common to A and B) / (Area of B) (3.4)

Slide 26: Independent Events-I

P(A) = P(A | B); P(B) = P(B | A)

Slide 27: “AND” - The Multiplication Rule The “joint distribution” of A and B

P(A and B) = P(A ∩ B) = P(A) · P(B | A)

P(A and B) = P(A) · P(B)

Slide 28: “AND” - The Multiplication Rule The “joint distribution” of A and B

Figure 28.1. Diagram: sample space S with two overlapping events A and B, their overlap shaded, illustrating the joint probability of A and B.

Note the multiplication. What’s another way to write this?

Pr{A, B} = (Area common to A and B) / (Area of S)

P(A and B) = P(A ∩ B) = P(A) · P(B | A)

Slide 29

Factoring joint distributions into conditionals “the chain rule”

P(A, B, C, D) = P(A|B,C,D)P(B|C,D)P(C|D)P(D)

The conditional distributions can further be simplified if variables are independent

Slide 30

Figure 30.1. Screenshot of a presentation slide titled 'So what?' from a Bayes' Theorem lecture (Che-Castaldo, Collins, Hobbs); the Connections section tab is highlighted. No figure content.

The conditional distributions can be represented by a Directed Acyclic Graph (DAG) based on the dependencies of the process

Slide 31

Figure 31.1. Directed acyclic graph and matching hierarchical Bayesian model: response y_ij depends on group intercept alpha_j, slope beta, and variance sigma-squared; alpha_j depends on hyperparameters mu_alpha and zeta-squared, with normal and inverse-gamma priors.

Bayesian models are often represented by DAGs

Slide 32: “OR” - The Additive Rule

Note the addition

Why?

P(A or B) = P(A ∪ B) = P(A) + P(B) − P(A and B)

P(A or B) = P(A) + P(B)

Slide 33: “OR” - The Additive Rule

The probability that events A or B will occur

Figure 33.1. Diagram: sample space S with two overlapping events A and B, overlap shaded, illustrating why the overlap is subtracted in the additive (OR) rule to avoid double counting.

To avoid double count

P(A or B) = P(A ∪ B) = P(A) + P(B) − P(A and B)

Slide 34: Using the Rules of Probability (Example)

Blood Type
OABABTotal
Rh factorPositive1561393712344
Negative28258465
Total1841644516409

Slide 35: Review of Concepts and Formulae

Slide 36: QUESTION: Prove the equality in Bayes rule using simple probability rules

P(A | B) = ( P(B | A) · P(A) ) / P(B)

Slide 37: BREAK: Up Next - Operationalizing Probability

(No text on this slide.)

Slide 38: Random Variables-I

Slide 39: Random Variables - II

Slide 40: Random Variables - III

Slide 41

Figure 41.1. Photo: a salmonid fish with the row of scales along its side labeled 'lateral line'.
Figure 41.2. Photo: a blue whale swimming in deep blue water.
Figure 41.3. Photo: a fathead minnow, a small silvery fish, in vegetation.

Random Variables - III

Slide 42: Probability Distributions (Discrete-I)

Slide 43: Probability Distributions (Discrete-II)

The probability of each value of the discrete random variable is between 0 and 1, inclusive.

The sum of all the probabilities is 1.

{xi : i = 1, …, N}

0 ≤ P(xi) ≤ 1

Σi=1N P(xi) = 1

Slide 44: Discrete Cumulative Distribution Function

F(x) = P(X ≤ x) = ∑x_i ≤ x P(X = xi) = ∑x_i ≤ x p(xi)

Slide 45: Discrete Cumulative Distribution Function

F(x) = P(X ≤ x) = ∑x_i ≤ x P(X = xi) = ∑x_i ≤ x p(xi)

P(a < X ≤ b) = FX(b) − FX(a)

Slide 46: Means, Variances and Standard Deviations-I

The mean of a discrete random variable is given by:

Each value of x is multiplied by its corresponding probability and the products are added.

This is just a weighted average!

μ = Σi=1N xi P(xi)

Slide 47: Expected Value

The expected value of a discrete random variable (jargon for the mean) is:

This is just a weighted average!

E(X) = μX = Σi=1N xi P(xi)

Slide 48: Means, Variances and Standard Deviations-II

Var{X} =

Recall that

Var{X} = E{X2} - (E{X})2

σ2 = Σi=1N (xi − μ)2 P(xi)

E(X) = μX = Σi=1N xi P(xi)

Slide 49

Figure 49.1. Concept-question slide showing three pmf bar charts over x = 1 to 5: (A) uniform flat, (B) triangular peaked at 3, (C) U-shaped with mass at the ends. Students order them by standard deviation.

Slide 50

Computation from tables

Example. Compute the variance and standard deviation of X.

values x12345
pmf p(x)1/102/104/102/101/10

Slide 51

Computation from tables

From the table we compute the mean:

μ = 1/10 + 4/10 + 12/10 + 8/10 + 5/10 = 3

Then we add a line to the table for (X − μ)2.

values X12345
pmf p(x)1/102/104/102/101/10
(X − μ)241014

Using the table we compute variance E((X − μ)2):

1/10 · 4 + 2/10 · 1 + 4/10 · 0 + 2/10 · 1 + 1/10 · 4 = 1.2

The standard deviation is then σ = √1.2.

Slide 52: Algebra with Expectation and Variance

Figure 52.1. A math equations on a white background Description automatically generated

Slide 53: Algebra with Expectation and Variance

Slide 54: Algebra with Expectation and Variance

If X and Y are independent, what is Var{X + Y}? Let’s derive rather than look at rules

Recall: Var{X} = E{X2} - (E{X})2

Slide 55: Answer: Algebra with Expectation and Variance

Recall: Var{X} = E{X2} - (E{X})2

So, variances of independent random variables add!

Slide 56: Key terms moving forward