0% found this document useful (0 votes)
2 views

Lec6_Probabilistic Reasoning(1)

This lecture focuses on probabilistic reasoning in artificial intelligence, covering key concepts such as probability, random variables, joint and marginal distributions, and decision-making under uncertainty. It emphasizes the importance of probabilistic models and inference techniques, including Bayes' rule and conditional independence. The lecture also discusses the application of these concepts in environments like the Wumpus World.

Uploaded by

Wong Brian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lec6_Probabilistic Reasoning(1)

This lecture focuses on probabilistic reasoning in artificial intelligence, covering key concepts such as probability, random variables, joint and marginal distributions, and decision-making under uncertainty. It emphasizes the importance of probabilistic models and inference techniques, including Bayes' rule and conditional independence. The lecture also discusses the application of these concepts in environments like the Wumpus World.

Uploaded by

Wong Brian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Artificial Intelligence

Lecture 6:Probabilistic Reasoning

Xiaojin Gong
2021-04-12

Credits: AI Course in Berkeley & JHU


1
Review
 Knowledge and reasoning
 Knowledge base
 Inference
 Propositional logic
 Inference: model checking, resolution, forward chaining

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:

 Which action to choose?


 Depends on my preferences for missing flight vs. airport cuisine, etc.
 Utility theory is used to represent and infer preferences
 Decision theory = probability theory + utility theory

7
Rational Decision

 Decision theory = probability theory + utility theory


 An agent is rational iff it chooses the action that yields the highest
expected utility, averaged over all the possible outcomes of the
action.
 A.k.a the principle of maximum expected utility.
8
Random Variable
 A random variable is some aspect of the world about which
we have uncertainty, e.g.
 R = Is it raining? {true, false}
 T = Is it hot or cold? {hot, cold}
 D = How long will it take to drive to airport? [0, ∞)

 We denote random variables with capital letters

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 ,⋯,𝑥𝑛 )∈𝐸

 From a joint distribution, we can calculate the probability of


any event:
 Probability that it’s hot AND sunny?
 Probability that it’s hot?
 Probability that it’s hot OR sunny?

 Typically, the events we care about are partial assignments,


like P(T=hot)
15
Marginal Distributions
 Marginal distributions are sub-tables which eliminate variables
 Marginalization (summing out): Combine collapsed rows by adding

𝑃 𝑇 = 𝑃(𝑇, 𝑊)
𝑊

𝑃 𝑊 = 𝑃(𝑇, 𝑊)
𝑇

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:
∀𝑥, 𝑦, 𝑧 𝑃 𝑥, 𝑦|𝑧 = 𝑃 𝑥|𝑧 𝑃(𝑦|𝑧)

 Conditional independence is our most basic and robust form


of knowledge about uncertain environments.
 Unconditional independence very rare.

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)?

 P(sun | winter, hot)?

23
Inference by Enumeration

 Worst-case time complexity O(dn)

 Space complexity O(dn) to store the joint distribution

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:

𝑃 𝑥1, 𝑥2, 𝑥3 = 𝑃 𝑥1 𝑃 𝑥2 𝑥1 𝑃 𝑥3 𝑥1, 𝑥2

𝑃 𝑥1, 𝑥2, … , 𝑥𝑛 = 𝑃(𝑥𝑖 |𝑥1 … 𝑥𝑖−1 )

26
Bayes’ Rule
 Two ways to factor a joint distribution:

𝑃 𝑥, 𝑦 = 𝑃 𝑦 𝑃 𝑥 𝑦 = 𝑃 𝑥 𝑃 𝑦 𝑥

𝑃 𝑦𝑥
⇒𝑃 𝑥𝑦 = 𝑃 𝑥
𝑃 𝑦

⇒𝑃 𝑥𝑦 ∝𝑃 𝑦𝑥 𝑃 𝑥

Posterior Likelihood Prior

27
Bayes’ Rule
𝑃 𝑦𝑥
𝑃 𝑥𝑦 = 𝑃 𝑥
𝑃 𝑦

 Why is this at all helpful?


 Build one conditional from its reverse
 Often one conditional is tricky but the other one is simple
 Foundation of many systems
 In the running for most important AI equation!

28
Inference with Bayes’ Rule
 Example:
 Diagnostic probability from causal probability:

 Example:
 Given:

 What is P(W | dry) ?


29
The Wumpus World

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy