UNIT-4 Uncertainty in Artificial Intelligence

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 38

UNIT-4

Uncertainty in Artificial Intelligence


Outline
Uncertainty
Probability
Syntax and Semantics
Inference
Independence and Bayes' Rule
Bayesian Network
Uncertainty
 In any type of situation(event), where we are not sure about whether that is
true or not then we cannot express Status of the event, this situation is called
uncertainty.
 So to represent uncertain knowledge, where we are not sure about the
predicates, we need uncertain reasoning or probabilistic reasoning
 Causes of uncertainty:
Following are some leading causes of uncertainty to occur in the real world.
 Information occurred from unreliable sources.
 Experimental Errors
 Equipment fault
 Temperature variation
 Climate change.
Probabilistic reasoning:
 Probabilistic reasoning is a way of knowledge
representation where we apply the concept of
probability to indicate the uncertainty in knowledge.

 In probabilistic reasoning, we combine probability


theory with logic to handle the uncertainty
 In probabilistic reasoning, there are two ways to solve
problems with uncertain knowledge:
 Bayes' rule
 Bayesian Statistics
Conditional probability:
 Conditional probability is a probability of occurring an
event when another event has already happened.

 Let's suppose, we want to calculate the event A when


event B has already occurred, "the probability of A
under the conditions of B", it can be written as:

 Where P(A⋀B)= Joint probability of A and B


 P(B)= Marginal probability of B.
Uncertainty
Example:
Let action At = leave for airport t minutes before flight
departure
Will At get me there on time?
 Problems:
Partial observability (road state, other drivers' plans, etc.)

1. risks falsehood: “A25 will get me there on time”, or


2. leads to conclusions that are too weak for decision making:

Hence a purely logical approach either


 Noisy sensors (traffic reports)
 Uncertainty in action outcomes (flat
tire, etc.)
 “A25will get me there on time if there's no
accident on the bridge and it doesn't
rain ,no breakdown and my tires remain
intact etc .”

 (A1440
might reasonably be said to get me
there on time but I'd have to stay
overnight in the airport …)
Making decisions under uncertainty
Suppose I believe the following:
P(A25 gets me there on time | …) = 0.04
 P(A90 gets me there on time | …) = 0.70
 P(A120 gets me there on time | …) = 0.95
 P(A1440 gets me there on time | …) = 0.9999

Which action to choose?


 Depends on my preferences for missing flight vs. time
spent waiting, etc etc
– Utility theory is used to represent and infer preferences
 – Decision theory = probability theory + utility theory
Methods for handling uncertainty
 ∀p Symptom(P,Toothache)Disease(p,Cavity)
The problem is that this rule is wrong.

∀p Symptom(P,Toothache)Disease(p,Cavity) V
Disease(p,Gum disease) V

Disease(p,Abscess)

Unfortunately, inorder to make the rule is true.

∀p Disease(p,Cavity) Symptom(P,Toothache)
But this rule is not right either; not painall cavities cause
we have a rule:
if toothache then problem is cavity
But not all patients have toothaches due to cavities
so we could set up rules like:
if toothache and not(gum disease) and not(filling)
and ... then problem = cavity
This gets complicated, a better method would be:
if toothache then problem is cavity with 0.8
probability or P(cavity|toothache) = 0.8
the probability of cavity is 0.8 given toothache is all
that is known
Probability basics

• Basic element: random variable

• A random variable is a function from sample points to some


range,e.g., the real or Booleans

• Similar to propositional logic: possible worlds defined


by assignment of values to random variables.
Types of random variables
• Propositional or Boolean random variables
e.g., Cavity (do I have a cavity?)
Cavity = true is a proposition, also written cavity
• Discrete random variables(finite or infinite)
• Weather=rain is a proposition
• Values must be exhaustive and mutually exclusive

• Continuous random variable(bounded or unbounded)


• E.g.temp=21.6 also allow e.g., temp<22.0

• Complex propositions formed from elementary propositions and


standard logical connectives e.g., Weather = sunny  Cavity = false


◦ e.g., Weather is one of
<sunny,rainy,cloudy,snow>
Axioms of probability
For any propositions A, B
i)All probabilities are between 0 and 1
0 ≤ P(A) ≤ 1
ii)P(true) = 1, P(false) = 0
probability of 1 for propositions believed to be absolutely
true
probability of 0 for propositions believed to be absolutely
false
iii)Theprobability of disjunction is given
P(A  B) = P(A) + P(B) - P(A  B)


Prior probability
• Prior or unconditional probabilities of propositions

e.g., P(Cavity = true) = 0.1 and P(Weather = sunny) = 0.72

correspond to belief prior to arrival of any (new) evidence


• Joint probability distribution for a set of random variables gives
the probability of every atomic event on those random variables

• P(Weather,Cavity) = a 4 × 2 matrix of values:

Weather = sunny rainy cloudy snow


Cavity = true 0.144 0.02 0.016 0.02
Cavity = false 0.576 0.08 0.064 0.08

• Every question about a domain can be answered by the joint


distribution
Inference by Numeration
 Start with the joint probability distribution:

For any proposition φ, sum the atomic events where it is true: P(φ) =
Σω:ω╞φ P(ω)
Q:what is the prb. If Mr.Bheem having toothache?
P(toothache)=0.108+.012+0.16+.064
=.20 or 20%


Inference by enumeration
• Start with the joint probability distribution:

• Can also compute conditional probabilities:


• Q:what is the probability, if mr.Bheem not having cavity given that he is having toothache?
P(cavity | toothache)

= P(cavity  toothache)
P(toothache)
= 0.016+0.064
0.108 + 0.012 + 0.016 + 0.064
= 0.4

Q:What is the prob. If the Mr.Bheem having toothache or cavity?


P(toothache V cavity)=.0.108+0.012+0.072+.008+0.016+.064
=.0.28
Conditional probability
 Conditional or posterior probabilities
e.g., P(cavity | toothache) = 0.8
i.e., given that toothache is all I know

 New evidence may be irrelevant, allowing


simplification, e.g.,
P(cavity | toothache, sunny) = P(cavity | toothache) = 0.8


Conditional probability
 Definition of conditional probability:
P(a | b) = P(a  b) / P(b) if P(b) > 0

 Product rule gives an alternative formulation:


P(a  b) = P(a | b) P(b) = P(b | a) P(a)

 Chain rule is derived by successive application of product rule:


P(X1, …,Xn)
= P(Xn | X1,...,Xn-1) P(Xn-1 | X1,...,Xn-2)
=…
= πi= 1^n P(Xi | X1, … ,Xi-1)



Independence
 A and B are independent iff
P(A|B) = P(A) or P(B|A) = P(B) or P(A, B) = P(A) P(B)

P(Toothache, Catch, Cavity, Weather)


= P(Toothache, Catch, Cavity) P(Weather)


Bayes' Rule
 P(ab) = P(a | b) P(b) = P(b | a) P(a)
 Bayes' rule: P(a | b) = P(b | a) P(a) / P(b)
 Useful for assessing diagnostic probability from causal probability
◦ P(Cause|Effect) = P(Effect|Cause) P(Cause) / P(Effect)

◦ 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) = P(s|m) P(m) / P(s) = 0.8 × 0.0001 / 0.1 = 0.0008
◦ Note: posterior probability of meningitis still very small!



Bayes' Rule and conditional
independence
P(Cavity | toothache  catch)
= αP(toothache  catch | Cavity) P(Cavity)
= αP(toothache | Cavity) P(catch | Cavity) P(Cavity)

• This is an example of a naïve Bayes model:


P(Cause,Effect1, … ,Effectn) = P(Cause) πiP(Effecti|Cause)

• Total number of parameters is linear in n




Bayesian networks
 A simple, graphical notation for conditional independence
assertions and hence for compact specification of full joint
distributions

 Syntax:
◦ a set of nodes, one per variable
◦ a directed, acyclic graph (link ≈ "directly influences")
◦ a conditional distribution for each node given its parents:
P (Xi | Parents (Xi))

 In the simplest case, conditional distribution represented as a


conditional probability table (CPT) giving the distribution over Xi
for each combination of parent values
Example
• Topology of network encodes conditional independence
assertions:

• Weather is independent of the other variables


• Toothache and Catch are conditionally independent given
Cavity
Example
• I'm at work, neighbor John calls to say my alarm is ringing, but
neighbor Mary doesn't call. Sometimes it's set off by minor
earthquakes. Is there a burglar?

• Variables: Burglary, Earthquake, Alarm, JohnCalls, MaryCalls

• Network topology reflects "causal" knowledge:


• A burglar can set the alarm off
• An earthquake can set the alarm off
• The alarm can cause Mary to call
• The alarm can cause John to call
Example contd.
Semantics
The full joint distribution is defined nas the product of the local conditional
distributions:
P (X1, … ,Xn) = πi = 1 P (Xi | Parents(Xi))

e.g., P(j  m  a  b  e)


= P (j | a) P (m | a) P (a | b, e) P (b) P (e)
Constructing Bayesian networks

1. Choose an ordering of variables X1, … ,Xn


2. For i = 1 to n
◦ add Xi to the network
◦ select parents from X1, … ,Xi-1 such that
P (Xi | Parents(Xi)) = P (Xi | X1, ... Xi-1)

This choice of parents guarantees:


= πi =1P (Xi | Parents(Xi)) (by construction)
 P (X1, … ,Xn) = πi =1 P (Xi | X1,
… , Xi-1) (chain rule)

Example
 Suppose we choose the ordering M, J, A, B, E

P(J | M) = P(J)?



Example
 Suppose we choose the ordering M, J, A, B, E

P(J | M) = P(J)?
P(A | J, M) = P(A | J)? P(A | J, M) = P(A)?

No

Example
• Suppose we choose the ordering M, J, A, B, E

P(J | M) = P(J)?
P(A | J, M) = P(A | J)? P(A | J, M) = P(A)? No
P(B | A, J, M) = P(B | A)?
P(B | A, J, M) = P(B)?
• No

Example
• Suppose we choose the ordering M, J, A, B, E

P(J | M) = P(J)?
P(A | J, M) = P(A | J)? P(A | J, M) = P(A)? No
P(B | A, J, M) = P(B | A)? Yes
P(B | A, J, M) = P(B)? No
P(E | B, A ,J, M) = P(E | A)?
P(E | B, A, J, M) = P(E | A, B)?
• No

Example
• Suppose we choose the ordering M, J, A, B, E

P(J | M) = P(J)?
P(A | J, M) = P(A | J)? P(A | J, M) = P(A)? No
P(B | A, J, M) = P(B | A)? Yes
P(B | A, J, M) = P(B)? No
P(E | B, A ,J, M) = P(E | A)? No
P(E | B, A, J, M) = P(E | A, B)? Yes
• No

Example contd.

 Deciding conditional independence is hard in noncausal


directions

 (Causal models and conditional independence seem hardwired


for humans!)
 Network is less compact: 1 + 2 + 4 + 2 + 4 = 13 numbers
needed
Summary
• Probability is a rigorous formalism for uncertain
knowledge

• Joint probability distribution specifies probability of


every atomic event
• Queries can be answered by summing over atomic
events

• For nontrivial domains, we must find a way to reduce


the joint size

• Independence and conditional independence provide the


tools

example
 Consider the problem domain in which when I go home I want to
know if someone in my family is home before I go in. Let's say I
know the following information: (1) Why my wife leaves the house,
she often (but not always) turns on the outside light. (She also
sometimes turns the light on when she's expecting a guest.) (2)
When nobody is home, the dog is often left outside. (3) If the dog
has bowel-troubles, it is also often left outside. (4) If the dog is
outside, I will probably hear it barking (though it might not bark, or
I might hear a different dog barking and think it's my dog).
O: Everyone is Out of the house
L: The Light is on
D: The Dog is outside
B: The dog has Bowel troubles
H: I can Hear the dog barking
Summary
Bayesian networks provide a natural
representation for (causally induced)
conditional independence
Topology + CPTs = compact
representation of joint distribution
Generally easy for domain experts to
construct

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