Lec6_Probabilistic Reasoning(1)
Lec6_Probabilistic Reasoning(1)
Xiaojin Gong
2021-04-12
2
Review
3
Outline
Probability
Random variables
Joint and marginal distributions
Conditional distribution
Product rule, chain rule, Bayes’ rule
Inference
Independence and conditional independence
4
Uncertainty
Task environments:
Partially observable
Non-deterministic
5
Uncertainty
General situation:
Observed variables (evidence): Agent knows certain things about
the state of the world (e.g., sensor readings or symptoms)
Unobserved variables: Agent needs to reason about other aspects
(e.g. where an object is or what disease is present)
Model: Agent knows something about how the known variables
relate to the unknown variables
Probabilistic reasoning gives us a framework for managing
our beliefs and knowledge
6
Making Decision Under Uncertainty
Example:
7
Rational Decision
9
Probability Distribution
Associate a probability with each value
∀𝑥 𝑃 𝑋 = 𝑥 ≥ 0,and 𝑃 𝑋=𝑥 =1
𝑥
Temperature Weather
10
Probability for Discrete Variables
Unobserved random variables have distributions
A distribution is a TABLE of probabilities of values
Temperature Weather
11
Probability for Continuous Variables
Probability density function
𝑃 𝑥 ≤ 𝑋 ≤ 𝑥 + 𝑑𝑥
𝑃 𝑥 = lim
𝑑𝑥→0 𝑑𝑥
12
Joint Probability Distribution
A joint probability distribution over a set of random
variables: 𝑋1 , ⋯ , 𝑋𝑛 specifies a real number of each
assignment (or outcome):
Denote: 𝑃 𝑋1 = 𝑥1 , ⋯ , 𝑋𝑛 = 𝑥𝑛 = 𝑃 𝑥1 , ⋯ , 𝑥𝑛
𝑃 𝑥1 , ⋯ , 𝑥𝑛 ≥ 0 , 𝑎𝑛𝑑 𝑃 𝑥1 , ⋯ , 𝑥𝑛 = 1
𝑥1 ,⋯,𝑥𝑛
13
Probabilistic Models
A probabilistic model is a joint distribution over a set of
random variables
Probabilistic models:
Random variables with domains
Assignments are called outcomes
Joint distributions: say whether assignments (outcomes) are likely
Normalized: sum to 1.0
Ideally: only certain variables directly interact
14
Events
An event is a set E of outcomes
𝑃 𝐸 = 𝑃 𝑥1 , ⋯ , 𝑥𝑛
(𝑥1 ,⋯,𝑥𝑛 )∈𝐸
𝑃 𝑇 = 𝑃(𝑇, 𝑊)
𝑊
𝑃 𝑊 = 𝑃(𝑇, 𝑊)
𝑇
16
Conditional Probabilities
Conditional distributions are probability distributions over
some variables given fixed values of others
𝑃(𝑊 = 𝑠, 𝑇 = 𝑐) 0.2
𝑃 𝑊=𝑠𝑇=𝑐 = = = 0.4
𝑃(𝑇 = 𝑐) 0.5
Joint probability:
𝑃 𝑠, 𝑐 = 𝑃 𝑠 𝑐 𝑃(𝑐)
17
Conditional Probability Distribution
Normalization:
𝑃(𝑊 = 𝑠, 𝑇 = 𝑐)
𝑃 𝑊=𝑠𝑇=𝑐 =
𝑃(𝑇 = 𝑐)
𝑃(𝑇 = 𝑐, 𝑊 = 𝑠)
=
𝑊 𝑃(𝑇 = 𝑐, 𝑊)
18
Independence
Two variables are independent (𝑋 ⊥ 𝑌) in a joint distribution
if:
𝑃 𝑋, 𝑌 = 𝑃 𝑋 𝑃 𝑌
∀𝑥, 𝑦 𝑃 𝑥, 𝑦 = 𝑃 𝑥 𝑃(𝑦)
19
Conditional Independence
X is conditionally independent of Y given Z (𝑋 ⊥ 𝑌|𝑍) iff:
∀𝑥, 𝑦, 𝑧 𝑃 𝑥, 𝑦|𝑧 = 𝑃 𝑥|𝑧 𝑃(𝑦|𝑧)
20
Probabilistic Inference
Probabilistic inference: compute a desired probability from
other known probabilities
We generally compute conditional probabilities
P(on time | no reported accidents) = 0.9
These represents the agent’s beliefs given the evidence
Probabilities change with new evidence:
P(on time | no accidents, 5 a.m.) = 0.95
P(on time | no accidents, 5 a.m., raining) = 0.80
Observing new evidence causes beliefs to be updated
21
Inference by Enumeration
General case:
Evidence variables: 𝐸1 ⋯ 𝐸𝑘 = 𝑒1 ⋯ 𝑒𝑘
Query variable: 𝑄 𝑋1 ⋯ 𝑋𝑛
Hidden variables: 𝐻1 ⋯ 𝐻𝑘 All variables
We want: 𝑃(𝑄|𝑒1 ⋯ 𝑒𝑘)
Solution:
Step 1: Select the entries consistent with the evidence
Step 2: Sum out H to get joint of Query and evidence
Step 3: Normalize
22
Inference by Enumeration
P(sun)?
P(sun | winter)?
23
Inference by Enumeration
24
The Product Rule
Infer the joint probability from conditional distributions
𝑃 𝑥, 𝑦 = 𝑃 𝑦 𝑃 𝑥 𝑦
25
The Chain Rule
The joint distribution can be written as an incremental
product of conditional distributions:
26
Bayes’ Rule
Two ways to factor a joint distribution:
𝑃 𝑥, 𝑦 = 𝑃 𝑦 𝑃 𝑥 𝑦 = 𝑃 𝑥 𝑃 𝑦 𝑥
𝑃 𝑦𝑥
⇒𝑃 𝑥𝑦 = 𝑃 𝑥
𝑃 𝑦
⇒𝑃 𝑥𝑦 ∝𝑃 𝑦𝑥 𝑃 𝑥
27
Bayes’ Rule
𝑃 𝑦𝑥
𝑃 𝑥𝑦 = 𝑃 𝑥
𝑃 𝑦
28
Inference with Bayes’ Rule
Example:
Diagnostic probability from causal probability:
Example:
Given:
30
The Wumpus World
Specifying the Probability Model
31
The Wumpus World
Observations and Query
32
The Wumpus World
Using Conditional Independence
33
The Wumpus World
34
The Wumpus World
35
Assignments
Reading assignment:
Ch. 13
36