PROBABILITY BASICS INTRODUCTION TO DATA ANALYSIS LEARNING GOALS - - PowerPoint PPT Presentation

probability basics
SMART_READER_LITE
LIVE PREVIEW

PROBABILITY BASICS INTRODUCTION TO DATA ANALYSIS LEARNING GOALS - - PowerPoint PPT Presentation

INTRODUCTION TO DATA ANALYSIS PROBABILITY BASICS INTRODUCTION TO DATA ANALYSIS LEARNING GOALS become familiar with the notion of probability axiomatic definition & interpretation joint, marginal & conditional probability


slide-1
SLIDE 1

PROBABILITY BASICS

INTRODUCTION TO DATA ANALYSIS

slide-2
SLIDE 2

INTRODUCTION TO DATA ANALYSIS

LEARNING GOALS

▸ become familiar with the notion of probability ▸ axiomatic definition & interpretation ▸ joint, marginal & conditional probability ▸ Bayes rule ▸ random variables ▸ probability distributions in R ▸ probability distributions as approximated by samples

slide-3
SLIDE 3

Probability

slide-4
SLIDE 4

INTRODUCTION TO DATA ANALYSIS

ELEMENTARY OUTCOMES AND EVENTS

▸ a random process has elementary outcomes ▸ elementary outcomes are mutually exclusive ▸

exhausts the space of possibilities

▸ any

is an event

▸ standard set-theoretic notation for negation, conjunction, disjunction etc. ▸ example “rolling an odd number”

Ω = {ω1, ω2, …} Ω A ⊆ Ω

slide-5
SLIDE 5

INTRODUCTION TO DATA ANALYSIS

PROBABILITY DISTRIBUTION

slide-6
SLIDE 6

INTRODUCTION TO DATA ANALYSIS

INTERPRETATIONS OF PROBABILITY

▸ Frequentist: probabilities are generalizations of intuitions/facts about

frequencies of events in repeated executions of a random event.

▸ Subjectivist: probabilities are subjective beliefs by a rational agent who is

uncertain about the outcome of a random event.

▸ Realist: probabilities are a property of an intrinsically random world.

slide-7
SLIDE 7
slide-8
SLIDE 8

INTRODUCTION TO DATA ANALYSIS

slide-9
SLIDE 9

INTRODUCTION TO DATA ANALYSIS

PROBABILITY DISTRIBUTIONS AS SAMPLES

▸ No matter our preferred metaphysical interpretation, we can approximate a

probability distribution by either:

▸ a large set of representative samples; or ▸ an oracle that returns a sample if needed.

I can you a sample give!

slide-10
SLIDE 10

Structured events

slide-11
SLIDE 11

INTRODUCTION TO DATA ANALYSIS

slide-12
SLIDE 12

INTRODUCTION TO DATA ANALYSIS

JOINT PROBABILITY DISTRIBUTIONS

▸ Structured elementary outcomes: ▸ shorthand notation

instead of

Ωflip−&−draw = Ωflip × Ωdraw P(heads, black) P(⟨heads, black⟩)

slide-13
SLIDE 13

INTRODUCTION TO DATA ANALYSIS

MARGINAL DISTRIBUTIONS

P(heads) = 0.5 ∑ ∑ P(tails) = 0.5 P(black) = 0.3 P(white) = 0.7

▸ if

and , the marginal probability of is:

Ω = Ω1 × …Ωn Ai ⊆ Ωi Ai P(Ai) = ∑

A1⊆Ω1,…,Ai−1⊆Ωi−1,Ai+1⊆Ωi+1,…,An⊆Ωn

P(A1, …, Ai−1, Ai, Ai+1, …An)

slide-14
SLIDE 14

Conditional probability & Bayes rule

slide-15
SLIDE 15

INTRODUCTION TO DATA ANALYSIS

CONDITIONAL PROBABILITY

P(A ∣ B) = P(A ∩ B) P(B)

▸ the conditional probability of A given B is:

P(heads) = 0.5 ∑ ∑ P(tails) = 0.5 P(black) = 0.3 P(white) = 0.7

P(black ∣ heads) = P(black, heads) P(heads) = 0.1 0.5 = 0.2

slide-16
SLIDE 16

INTRODUCTION TO DATA ANALYSIS

BAYES RULE

P(B ∣ A) = P(A ∣ B) P(B) P(A)

▸ Bayes rule follows

straightforwardly from the definition of conditional probability:

P(A ∩ B) = P(B ∣ A) P(A) P(B ∩ A) = P(A ∣ B) ⋅ P(B)

P(A ∣ B) = P(A ∩ B) P(B)

slide-17
SLIDE 17

INTRODUCTION TO DATA ANALYSIS

PREVIEW ::: BAYES RULE FOR DATA ANALYSIS

P(B ∣ A) = P(A ∣ B) P(B) P(A)

P(θ ∣ D) = P(D ∣ θ) P(θ) P(D)

prior over parameters likelihood of data marginal likelihood of data posterior over parameters

slide-18
SLIDE 18

Random variables

slide-19
SLIDE 19

INTRODUCTION TO DATA ANALYSIS

RANDOM VARIABLES

▸ a random variable is a function: ▸ if range of is countable, we speak of a discrete random variable ▸ otherwise, we speak of a continuous random variable ▸ think: distribution of a summary statistic ▸ notation: ▸ shorthand notation

instead of

▸ similarly write stuff like

  • r

X : Ω → ℝ X P(X = x) P({ω ∈ Ω ∣ X(ω) = 2}) P(X ≤ x) P(1 ≤ X ≤ 2)

slide-20
SLIDE 20

INTRODUCTION TO DATA ANALYSIS

RANDOM VARIABLE ::: EXAMPLES

slide-21
SLIDE 21

INTRODUCTION TO DATA ANALYSIS

CUMULATIVE DISTRIBUTION & PROBABILITY MASS ::: DISCRETE RVS

Binom(K = k; n, θ) = ( n k) θk (1 − θ)n−k probability mass function

slide-22
SLIDE 22

INTRODUCTION TO DATA ANALYSIS

CUMULATIVE DISTRIBUTION & PROBABILITY MASS ::: DISCRETE RVS

Binom(K = k; n, θ) = ( n k) θk (1 − θ)n−k cumulative probability function

slide-23
SLIDE 23

INTRODUCTION TO DATA ANALYSIS

CUMULATIVE DISTRIBUTION & PROBABILITY MASS ::: CONTINUOUS RVS

𝒪(X = x; μ, σ) = 1 2σ2π exp (− (x − μ)2 2σ2 ) probability density function

slide-24
SLIDE 24

INTRODUCTION TO DATA ANALYSIS

CUMULATIVE DISTRIBUTION & PROBABILITY MASS ::: CONTINUOUS RVS

𝒪(X = x; μ, σ) = 1 2σ2π exp (− (x − μ)2 2σ2 ) cumulative probability function

slide-25
SLIDE 25

INTRODUCTION TO DATA ANALYSIS

EXPECTED VALUE OF A RANDOM VARIABLE

▸ the expected value of random variable

is: if is discreet: if is continuous:

  • think: mean of a representative sample of

X : Ω → ℝ X 𝔽X = ∑

x

x fX(x) X 𝔽X = ∫ x fX(x) dx X

slide-26
SLIDE 26

INTRODUCTION TO DATA ANALYSIS

VARIANCE OF A RANDOM VARIABLE

▸ the variance of random variable

is: if is discreet: if is continuous:

  • think: variance of a representative sample of

X : Ω → ℝ X

Var(X) = ∑

x

(𝔽X − x)2 fX(x) X

Var(X) = ∫ (𝔽X − x)2 fX(x) dx

X

slide-27
SLIDE 27

INTRODUCTION TO DATA ANALYSIS

COMPOSITE RANDOM VARIABLES

▸ we can compose random variables with standard mathematical operations

e.g., , where and are random variables

▸ easy to conceive of this in terms of samples

Z = X + Y X Y

slide-28
SLIDE 28

Probability distributions in R

slide-29
SLIDE 29

INTRODUCTION TO DATA ANALYSIS

PROBABILITY DISTRIBUTIONS IN R

▸ for each distribution mydist, there are four types of functions ▸ dmydist(x, ...) density function gives the (mass/density)

for x

▸ pmydist(x, ...) cumulative probability function gives cumulative distribution

for x

▸ qmydist(p, ...) quantile function gives value x with p = pmydist(x, ...) ▸ rmydist(n, ...) random sample function returns n samples from the

distribution

f(x) F(x)

slide-30
SLIDE 30

INTRODUCTION TO DATA ANALYSIS

EXAMPLE ::: NORMAL DISTRIBUTION