20
Probability Raul Queiroz Feitosa These slides are mostly inspired on slides from Christofer Bishop www.computervisiontalks.com/graphical-models-1-christopher-bishop-mlss-2013-tubingen/

Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Probability

Raul Queiroz Feitosa

These slides are mostly inspired on slides from Christofer Bishop www.computervisiontalks.com/graphical-models-1-christopher-bishop-mlss-2013-tubingen/

Page 2: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

11/6/2019 Probability 2

Objective

Recall some fundamentals of Probability Theory.

Page 3: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Interpretation of Probability

Frequentist:

Limit of an infinite number of trials.

Bayesian

A way to quantify uncertainty.

11/6/2019 Probability 3

Page 4: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Discrete Random Variables

A discrete random variable X can take on any value on a finite

or countable set of values X.

The probability that 𝑋=𝑥 is denoted by 𝑃 𝑋 = 𝑥 , or just, 𝑃 𝑥 ,

whereby and

𝑝() is called the probability mass function (pmf).

Example: for X={1,2,3,4}

11/6/2019 Probability 4

0 ≤ 𝑃 𝑥 ≤ 1 𝑃 𝑥 = 1

𝑥∈𝐗

1

1 2 3 4

.10

.30 .45

.15

𝑥

𝑝𝑥

Page 5: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

A murder has been committed. Two suspects:

Butler Cook

There are three possible murder weapons:

Pistol Knife fireplace Poker

Murder mystery

11/6/2019 Probability 5

Page 6: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Prior Distribution

Prior Probability expresses the belief that an event

might occur without taking any evidence into

account.

Butler has served the family for many years.

Cook hired recently, rumors of dodgy history.

𝑃 Culprit = Butler = 20%

𝑃 Culprit = Cook = 80%

Probabilities add up to 100%.

11/6/2019 Probability 6

𝑃 Culprit

Culprit ∈ Butler, Cook

This is called a

factor graph

Page 7: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Conditional Distribution

Conditional distribution expresses the belief that

an event might occur given some observation(s) or

evidence(s).

Butler is an ex-army and keeps a pistol in a locked drawer.

Cook has access to lot of knives.

𝑃 Weapon Culprit)

11/6/2019 Probability 7

Pistol Knife Poker

Cook 5% 65% 30%

Butler 80% 10% 10%

=100%

=100%

Page 8: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Joint Distribution

Joint Probability expresses the belief that multiple

joint events occur.

What is the probability that the Cook committed the murder

with a Pistol?

𝑃 Culprit = Cook = 20%

𝑃 Weapon = Pistol | Culprit = Cook = 80%

𝑃 Weapon = Pistol , Culprit = Cook = 20% × 80% = 16%

Likewise for other combinations of Weapon and Culprit.

11/6/2019 Probability 8

Page 9: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Joint Distribution

𝑃(Weapon, Culprit)=𝑃 Weapon Culprit) 𝑃(Culprit)

product rule

11/6/2019 Probability 9

Pistol Knife Poker

Cook 4% 52% 24%

Butler 16% 2% 2% =100%

𝑃(𝑦, 𝑥)=𝑃 𝑦 𝑥) 𝑃(𝑥)

joint

distribution

conditional

distribution

prior/marginal

distribution

Page 10: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Generative Viewpoint

Murderer Weapon

Cook Knife

Butler Knife

Cook Pistol

Cook Poker

Cook Knife

Butler Pistol

Cook Poker

Cook Knife

Butler Pistol

Cook Knife

… …

11/6/2019 Probability 10

pistol

knife

poker

poker

pistol

knife

Cook

Butler

Page 11: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Marginal Distribution

Marginal Probability is the probability that an

event occurred obtained by summing over the

probabilities of all other events.

Given the joint distribution (weapon, culprit), what is the

probability distribution that murder was committed with a

Pistol?

𝑃 Weapon = Pistol , Culprit = Cook = 4% 𝑃 Weapon = Pistol , Culprit = Butler = 16%

𝑃 Weapon = Pistol = 4%+ 16% = 20%

Likewise for other weapons.

11/6/2019 Probability 11

Page 12: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Marginal Distribution 𝑃(Culprit)=𝑃 Weapon = Pistol, Culprit +

+𝑃 Weapon = Knife, Culprit + 𝑃 Weapon = Poker, Butler

𝑃(Weapon)=𝑃 Weapon, Culprit = Cook +

+𝑃(Weapon, Culprit = Butler)

sum rule

11/6/2019 Probability 12

Pistol Knife Poker Total

Cook 4% 52% 24% 80%

Butler 16% 2% 2% 20%

Total 20% 54% 26% 100%

𝑃 𝑥 = 𝑃(𝑥, 𝑦)

𝑦

marginal

distribution

of culprit

(=prior)!

joint

distributions

marginal distribution

of weapon

Page 13: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Posterior Distribution

Posterior Probability is the revised of prior after

receiving additional information.

A Pistol was found in the scene of the crime.

11/6/2019 Probability 13

Pistol Knife Poker

Cook 4% 52% 24%

Butler 16% 2% 2%

𝑃 Culprit Pistol) =𝑃(Weapon=Pistol,Culprit)

𝑃 Weapon=Pistol,Culprit=Cook +𝑃(Weapon=Pistol,Culprit=Butler)

= 𝑃 Weapon=Pistol Culprit)𝑝(Culprit)

𝑃(Weapon=Pistol)

Page 14: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Generative Viewpoint

Murderer Weapon

Cook Knife

Butler Knife

Cook Pistol

Cook Poker

Cook Knife

Butler Pistol

Cook Poker

Cook Knife

Butler Pistol

Cook Knife

… …

11/6/2019 Probability 14

A Pistol was found in the scene of the crime.

Page 15: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Posterior Distribution

.

Bayes rule

11/6/2019 Probability 15

Pistol Knife Poker

Cook 4% 52% 24%

Butler 16% 2% 2%

𝑃 𝑥|𝑦 =𝑃(𝑥, 𝑦)

𝑃(𝑦)

Joint distribution

Pistol Knife Poker

Cook 20% 96% 92%

Butler 80% 4% 8%

Posterior distribution 𝑝 Culprit Weapon)

𝑃 𝑥|𝑦 =𝑃 𝑦 𝑥 𝑃(𝑥)

𝑃(𝑦)

Page 16: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Bayes Theorem

It follows from the product rule

11/6/2019 Probability 16

𝑃(𝑦, 𝑥)=𝑃 𝑦 𝑥) 𝑃(𝑥) =𝑃 𝑥 𝑦) 𝑃(𝑦)

𝑃 𝑥 𝑦) = 𝑃 𝑦 𝑥) 𝑃(𝑥) 𝑃(𝑦)

prior

posterior

likelihood

𝑃 𝑦 = 𝑃 𝑦 𝑥 𝑃(𝑥)

𝑥

marginal

Page 17: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

The Rules of Probability

Sum Rule

Product Rule

Bayes Theorem

Denominator

11/6/2019 Probability 17

𝑃 𝑥 = 𝑃(𝑥, 𝑦)

𝑦

𝑃(𝑥, 𝑦)=𝑃 𝑥 𝑦)𝑃(𝑦)=𝑃 𝑦 𝑥) 𝑃(𝑥)

𝑃 𝑦 𝑥) = 𝑃 𝑥 𝑦) 𝑃(𝑦) 𝑃(𝑥)

𝑃 𝑥 = 𝑃 𝑥 𝑦)𝑃(𝑦)

𝑦

Page 18: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Continuous Random Variables A continuous random variable X can take any real value.

The probability that 𝑋≤𝑞, denoted by 𝐹 𝑞 = 𝑃 𝑋 ≤ 𝑞 is called

cumulative probability density or cdf.

We define the probability density function - pdf as

11/6/2019 Probability 18

𝑝 𝑥 =𝑑𝐹 𝑥

𝑑𝑥

𝑝 𝑥

𝐹 𝑥

𝑥

𝑝𝑥

𝐹𝑥

May take values

greater than 1

Page 19: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

The Rules of Probability

Assuming that x is continuous and y is discrete

Sum Rule

Product Rule

Bayes Theorem

Denominator

11/6/2019 Probability 19

𝑝 𝑥 = 𝑝(𝑥, 𝑦)

𝑦

𝑝(𝑥, 𝑦)=𝑝 𝑥 𝑦)𝑃 𝑦 𝑃(𝑦)=𝑃 𝑦 𝑥) 𝑝(𝑥)

𝑃 𝑦 𝑥) = 𝑝 𝑥 𝑦) 𝑃(𝑦)𝑝(𝑥)

𝑝 𝑥 𝑦) = 𝑃 𝑦 𝑥) 𝑝(𝑥) 𝑃(𝑦)

𝑝 𝑥 = 𝑝 𝑥 𝑦)𝑃 𝑦 𝑃 𝑦 = 𝑝 𝑥, 𝑦 𝑑𝑥+∞

−∞𝑦

𝑃 𝑦 = 𝑝 𝑥, 𝑦 𝑑𝑥+∞

−∞

Page 20: Geometric Camera Calibrationraul/ImageAnalysis/Probability Fundamentals 02… · Prior Probability expresses the belief that an event might occur without taking any evidence into

Probability

END

11/6/2019 Graphical Models 20