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

Unit-4 Uncertainty

The document discusses uncertainty and probabilistic models for representing and reasoning about uncertainty. It covers representing uncertainty using probability theory and Bayesian probabilities, and using probabilistic models and joint probability distributions to perform inference under uncertainty.

Uploaded by

parthc2002
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)
8 views

Unit-4 Uncertainty

The document discusses uncertainty and probabilistic models for representing and reasoning about uncertainty. It covers representing uncertainty using probability theory and Bayesian probabilities, and using probabilistic models and joint probability distributions to perform inference under uncertainty.

Uploaded by

parthc2002
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/ 49

Uncertainty

Inference

• All kings who are greedy are Evil


• ∀x king(x) ∧ greedy (x) → Evil (x)

•King(John) ∧ Greedy (John) → Evil (John)


•King(Richard) ∧ Greedy (Richard) → Evil (Richard)
•King(Father(John)) ∧ Greedy (Father(John)) → Evil (Father(John))

•Example: Let's say that,


•"Priyanka got good marks in English."
•"Therefore, someone got good marks in English."
Uncertainty
–Let action A(t) denote leaving for the airport t
minutes before the flight
–For a given value of t, will A(t) get me there on time?
•Problems:
–Partial observability (roads, other drivers’ plans, etc.)
–Noisy sensors (traffic reports)
–Uncertainty in action outcomes (flat tire, etc.)
–Immense complexity of modeling and predicting
traffic
How To Deal With
Uncertainty
–Implicit methods:
–Ignore uncertainty as much as possible
–Build procedures that are robust to uncertainty
–This is the approach in the planning methods
studied so far (e.g. monitoring and replanning)
–Explicit methods
–Build a model of the world that describes the
uncertainty (about the system’s state, dynamics,
sensors, model)
–Reason about the effect of actions given the model
Methods for Handling Uncertainty
•Default (non-monotonic) logic: make assumptions unless
contradicted by evidence.
–E.g. “Assume my car doesnt have a flat tire.
What assumptions are reasonable? What about contradictions?
•Rules with fudge factor:
–E.g. “Sprinkler →0.99 WetGrass”, “WetGrass →0.7 Rain”
But: Problems with combination (e.g. Sprinkler causes
rain?)
•Probability:
–E.g. Given what I know, A(25) succeed with probability 0.2
•Fuzzy logic:
–E.g. WetGrass is true to degree 0.2
But: Handles degree of truth, NOT uncertainty.
Why Not Use First-Order Logic?
•A purely logical approach has two main
problems:
–Risks falsehood
∗A(25) will get me there on time.
–Leads to conclusions that are too weak:
∗A(25) will get me there on time if there is
no accident on the bridge and it does not
rain and my tires remain intact, etc. etc.
∗A(1440) might reasonably be said to get
me there on time (but I would have to stay
overnight at the airport!)
Knowledge Representation

KR Language Ontological Commitment Epistemological Commitment


Propositional Logic facts true, false, unknown
First Order Logic facts, objects, relations true, false, unknown
Temporal Logic facts, objects, relations, times true, false, unknown
Probability Theory facts degree of belief
Fuzzy Logic facts, degree of truth known interval values

Probabilistic Relational Models


- combine probability and first order logic
Probability
•A well-known and well-understood framework for
dealing with uncertainty
•Has a clear semantics
•Provides principled answers for:
–Combining evidence
–Predictive and diagnostic reasoning
–Incorporation of new evidence
•Can be learned from data
•Intuitive to human experts (arguably?)
Logic vs. Probability
Symbol: Q, R … Random variable: Q …

Boolean values: T, F Domain: you specify


e.g. {heads, tails} [1, 6]
State of the world: Atomic event: complete
Assignment to Q, R … Z specification of world: Q… Z
• Mutually exclusive
• Exhaustive
Prior probability (aka
Unconditional prob: P(Q)
Joint distribution: Prob.
of every atomic event
•4
Need for Reasoning w/ Uncertainty
• The world is full of uncertainty
– chance nodes/sensor noise/actuator error/partial info..
– Logic is brittle
• can’t encode exceptions to rules
• can‘t encode statistical properties in a domain
– Computers need to be able to handle uncertainty
• Probability: new foundation for AI (& CS!)
• Massive amounts of data around today
– Statistics and CS are both about data
– Statistics lets summarize and understand it
– Statistics is the basis for most learning
• Statistics lets data do our work for us
•3
Beliefs (Bayesian Probabilities)
•We use probability to describe uncertainty due to:
–Laziness: failure to enumerate exceptions, qualifications etc.
–Ignorance: lack of relevant facts, initial conditions etc.
–True randomness? Quantum effects? ...
•Beliefs (Bayesian or subjective probabilities) relate
propositions to one’s current state of knowledge
–E.g. P(A(25)| no reported accident) = 0.1
These are not assertions about the world / absolute truth
•Beliefs change with new evidence:
–E.g. P(A(25)| no reported accident, 5am) = 0.2
•This is analogous to logical entailment: KB given the KB, but
may not be true in general.
Making Decisions
Under Uncertainty

•Suppose I believe the following:


P(A(25) gets me there on time | ... ) = 0.04
P(A(90) gets me there on time | ... ) = 0.70
P(A(120) gets me there on time | ... ) = 0.95
P(A(1440) gets me there on time |... ) = 0.9999
•Which action should I choose?
Making Decisions
Under Uncertainty
•Suppose I believe the following:
P(A(25) gets me there on time | ... ) = 0.04
P(A(90) gets me there on time | ... ) = 0.70
P(A(120) gets me there on time | ... ) = 0.95
P(A(1440) gets me there on time |... ) = 0.9999
•Which action should I choose?
•Which action should I choose?
–Depends on my preferences for missing flight vs.
airport cuisine, etc.
–Utility theory is used to represent and infer
preferences.
–Decision theory = utility theory + probability theory
Random Variables

•A random variable X describes an outcome that cannot be


determined in advance
–E..g. The roll of a die
–E.g. Number of e-mails received in a day
•The sample space (domain) S of a random variable X is the set
of all possible values of the variable
– E.g. For a die, S = {1, 2, 3, 4, 5, 6}
–E.g. For number of emails received in a day, S is the natural
numbers
•An event is a subset of S.
–E.g. e = {1} corresponds to a die roll of 1
–E.g. number of e-mails in a day more than 100
Probability for Discrete
Random Variables
•Usually, random variables are governed by some “law of
nature”, described as a probability function P defined on S.
•P (x) defines the chance that variable X takes value x ∈ S.
– E.g. for a die roll with a fair die, P (1) = P (2) = ·· · = P (6) =
1/6
•Note that we still cannot determine the value of X, just the
chance of encountering a given value
•If X is a discrete variable, then a probability space P (x) has the
following properties:

0 ≤ P (x) ≤ 1, ∀x ∈ S and P (x) = 1


x∈S
Types of Probability Spaces

•6
Probability Basics
• Begin with a set S: the sample space
– e.g., 6 possible rolls of a die.
• x ϵ S is a sample point/possible world/atomic event
• A probability space or probability model is a sample
space with an assignment P(x) for every x s.t.
0≤P(x)≤1 and ∑P(x) = 1
• An event A is any subset of S
– e.g. A= ‘die roll < 4’
• A random variable is a function from sample points
to some range, e.g., the reals or Booleans
Axioms of Probability
•Beliefs satisfy the axioms of probability.
•For any propositions A, B:
1. 0 ≤ P (A) ≤ 1
2. P (True) = 1 (hence P (False) = 0)

3. P (A ∨ B) = P (A)+ P (B) − P (A ∧ B)
4. Alternatively, if A and B are mutually exclusive (A ∧ B = F )
then:
P (A ∨ B) = P (A)+ P (B)

•The axioms of probability limit the class of functions that can be


considered probability functions.
Axioms of Probability Theory
• All probabilities between 0 and 1
– 0 ≤ P(A) ≤ 1
– P(true) = 1
– P(false) = 0.
• The probability of disjunction is:
P( A  B) = P( A) + P(B) − P( A  B)

A  B
A
Tru

B
e

•© UW CSE AI Faculty •7
Beliefs
•We use probability to describe the world and existing
uncertainty
•Agents will have beliefs based on their current state of
knowledge
– E.g. P(Some day AI agents will rule the world)=0.2 reflects a
personal belief, based on one’s state of knowledge about
current AI, technology trends etc.
•Different agents may hold different beliefs, as these are
subjective
•Beliefs may change over time as agents get new evidence
•Prior (unconditional) beliefs denote belief prior to the arrival of
any new evidence.
Defining Probabilistic Models
•We define the world as a set of random variables Ω
= {X 1 .. . X n }.
•A probabilistic model is an encoding of probabilistic
information that allows us to compute the
probability of any event in the world
•The world is divided into a set of elementary,
mutually exclusive events, called states
– E.g. If the world is described by two Boolean
variables A, B, a state will be a complete
assignment of truth values for A and B.
•A joint probability distribution function assigns non-
negative weights to each event, such that these
weights sum to 1.
Prior Probability

Joint distribution can answer any question


•2
2
Prior Probability

Joint distribution can answer any question


•2
3
Inference using Joint Distributions
E.g. Suppose Happy and Rested are the random variables:

The unconditional probability of any proposition is computable as


the sum of entries from the full joint distribution

•E.g. P(Happy) = P(Happy, Rested) +P(Happy, ¬ Rested) = 0.65


Conditional Probability
•The basic statements in the Bayesian framework
talk about conditional probabilities.
–P (A|B) is the belief in event A given that event B
is known with certainty
–Conditional probabilities are written like P(A|B),
which can be read to mean, "the probability
that A happens Given B has happened."
•The product rule gives an alternative formulation:
P (A ∧ B) = P (A|B)P (B) = P (B|A)P (A)
–Note: we often write P (A, B) as a shorthand for P
(A ∧ B)
Conditional Probability
• P(A | B) is the probability of A given B
• Assumes that B is the only info known.
• Defined by: P( A  B)
P( A | B) =
P(B)

A AB B
Tru
e

•© UW CSE AI Faculty • 10
Chain Rule/Product Rule
• P(X1, …, Xn) = P(Xn|X1..Xn-1)P(Xn-1|X1..Xn-2)… P(X1)
= ПP(Xi|X1,..Xi-1)
Dilemma at the Dentist’s

What is the probability of a cavity given a toothache?


What is the probability of a cavity given the probe catches?

• 12
Conditional probability
• Conditional or posterior probabilities
e.g., P(cavity | toothache) = 0.8
i.e., given that toothache is all I know there is 80% chance of cavity

• Notation for conditional distributions:


P(Cavity | Toothache) = 2-element vector of 2-element vectors)

• If we know more, e.g., cavity is also given, then we have


P(cavity | toothache, cavity) = 1

• New evidence may be irrelevant, allowing simplification:


P(cavity | toothache, sunny) = P(cavity | toothache) = 0.8

• This kind of inference, sanctioned by domain knowledge, is crucial


•2
9
Inference by Enumeration

•30
Inference by Enumeration

P(toothache)=.108+.012+.016+.064
= .20 or 20%
•31
Inference by Enumeration

P(toothachecavity)??=

•32
Inference by Enumeration

?? + .008
P(toothachecavity) = .20 + .072
.28
•33
Inference by Enumeration

•34
Independence
• A and B are independent iff:
P(A| B) = P(A) These two constraints are
logically equivalent
P(B | A) =P(B)

• Therefore, if A and B are independent:


P( A  B)
P( A | B) = = P( A)
P(B)

P( A  B) = P( A)P(B)
•35
Independence

31 10;

Complete independence is powerful but rare


What to do if it doesn’t hold?
•36
Conditional Independence II
P(catch | toothache, cavity) = P(catch | cavity)
P(catch | toothache,cavity) = P(catch |cavity)

Why only 5 entries in table?

•37
Power of Cond. Independence
• Often, using conditional independence
reduces the storage complexity of the joint
distribution from exponential to linear!!

• Conditional independence is the most basic &


robust form of knowledge about uncertain
environments.

•38
Bayes Rule Bayes rules!

posterior

P(x, y) = P(x | y)P( y) = P( y | x)P(x)


P( y | x) P(x) likelihood prior
P(x y) = =
P( y) evidence

•39
Computing Diagnostic Prob. from Causal Prob.

E.g. let M be meningitis, S be stiff neck


P(M) = 0.0001,
P(S) = 0.1,
P(S|M)= 0.8

P(M|S)

•40
Other forms of Bayes Rule
P( y | x) P(x) likelihood  prior
P(x y) = =
P( y) evidence
P( y | x) P(x)
P(x y) =
 P( y | x) P(x)
x

P(x y) = P( y | x)P(x)


posterior  likelihood prior
Conditional Bayes Rule

P( y | x, z) P(x | z)
P(x y, z) =
P(y | z)
P( y | x, z) P(x, z)
P(x y, z) =
 P( y | x, z) P(x | z)
x

P(x y, z) = P( y | x, z)P(x | z)


Bayes’ Rule & Cond. Independence

•43
Simple Example of State Estimation
• Suppose a robot obtains measurement z
• What is P(doorOpen|z)?

•44
Causal vs. Diagnostic Reasoning

• P(open|z) is diagnostic.
• P(z|open) is causal.
• Often causal knowledge is easier to obtain.
count frequencies!
• Bayes rule allows us to use causal knowledge:

P(open | z) = P(z | open)P(open)


P(z)

•45
Example
• P(z|open) = 0.6 P(z|open) = 0.3
• P(open) = P(open) = 0.5

P(z |open)P(open)
P(open| z) =
P(z | open) p(open) + P(z | open) p(open)
0.60.5 2
P(open| z) = = = 0.67
0.6  0.5 + 0.3 0.5 3

• z raises the probability that the door is open.

•46
Combining Evidence
• Suppose our robot obtains another observation z2.

• How can we integrate this new information?

• More generally, how can we estimate


P(x| z1...zn )?

•47
Example: Second Measurement

• P(z2|open) = 0.5 P(z2|open) = 0.6


• P(open|z1)=2/3
P(z 2 | open) P(open| z1 )
P(open | z2 , z1 ) =
P(z 2 | open) P(open | z1 ) + P(z 2 | open) P(open | z1 )
1 2

2 3 5
= = = 0.625
1 2 3 1 8
 + 
2 3 5 3

• z2 lowers the probability that the door is open.


•32
These calculations seem
laborious to do for each
problem domain –
is there a general
representation scheme for
probabilistic inference?

Yes – Bayesian Networks

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