Probability

M. Drew LaMar
February 6, 2017

“I believe that we do not know anything for certain, but everything probably.”

- Christiaan Huygens

Course Announcements

  • Lab #4: DataCamp: Intermediate R
    • Chapter 3: Functions
    • Chapter 4: The apply family
    • Due February 15-16
  • HW #4 posted! Due Mon., Feb. 13, 5pm
    • W&S Ch. 5 + R&C Ch. 2
    • Datasets now will be posted with HW
  • NO READING ASSIGNMENT FOR WEDNESDAY
  • Exam #1: Friday, February 17 (in class)
    • No R on the exam!
    • Calculators allowed

In The News

Understanding uncertainty: Visualising probabilities

Ian Short & Mike Pearson

Language: Confidence Intervals

Definition: A confidence interval is a range of values surrounding the sample estimate that is likely to contain the population parameter.

Definition: A 95% confidence interval provides a most-plausible range for a parameter. Values lying within the interval are most plausible, whereas those outside are less plausible, based on the data.

Probability Basics

Definition: A random trial is a process or experiment that has two or more possible outcomes whose occurrence cannot be predicted with certainty.

Definition: An event is any potential subset of all the possible outcomes of a random trial.

Definition: The probability of an event is the proportion of times the event would occur if we repeated a random trial over and over again under the same conditions. Probability ranges between zero and one.

Random sampling as a random trial

Instead of events, we have values of random variables.

Parasitic wasps (yuck!): Two categorical variables - Parasitized or not; sex of laid egg (M or F)

The Formulas and Venn Diagrams

Definition: General addition rule \[ \mathrm{Pr[A \ or \ B]} = \mathrm{Pr[A]} + \mathrm{Pr[B]} - \mathrm{Pr[A \ and \ B]} \]

Conditional Probabilities

Definition: The conditional probability of an event is the probability of that event occurring given that another event has already occurred.

Definition: The conditional probability of an event B given that A occurred is \[ \mathrm{Pr[B \ | \ A]} = \frac{\mathrm{Pr[A \ and \ B]}}{\mathrm{Pr[A]}} \]

Definition: General multiplication rule \[ \mathrm{Pr[A \ and \ B]} = \mathrm{Pr[A]}\times\mathrm{Pr[B \ | \ A]} \]

Bayes Rule

Definition: The conditional probability of an event A given that B occurred is \[ \mathrm{Pr[B \ | \ A]} = \frac{\mathrm{Pr[A \ and \ B]}}{\mathrm{Pr[A]}} \]

Definition: General multiplication rule \[ \mathrm{Pr[A \ and \ B]} = \mathrm{Pr[B \ | \ A]}\times\mathrm{Pr[A]} \]

Definition: General multiplication rule \[ \mathrm{Pr[A \ and \ B]} = \mathrm{Pr[A \ | \ B]}\times\mathrm{Pr[B]} \]

Definition: Bayes Rule \[ \mathrm{Pr[B \ | \ A]} = \frac{\mathrm{Pr[A \ | \ B]}\times \mathrm{Pr[B]}}{\mathrm{Pr[A]}} \]

Mutually exclusive vs. independence

Commonly confused!

Definition: Two events are mutually exclusive if they cannot both occur at the same time. \[ \mathrm{Pr[A \ and \ B]} = 0 \]

Definition: Two events are independent if the occurrence of one does not inform us about the probability that the second will occur. \[ \mathrm{Pr[B \ | \ A]} = \mathrm{Pr[B]} \]

Mutually exclusive vs. independence

These two conditions simplify the general additive and multiplicative rules:

If two events are mutually exclusive, then \[ \mathrm{Pr[A \ or \ B]} = \mathrm{Pr[A]} + \mathrm{Pr[B]} \]

If two events are independent, then \[ \mathrm{Pr[A \ and \ B]} = \mathrm{Pr[A]} \times \mathrm{Pr[B]} \]

Visualizing dependency

Independent events

Dependent events

Mosaic plots are awesome!