190 likes | 375 Views
Probabilistic Reasoning. Introduction to Artificial Intelligence CS440/ECE448 Lecture 17. Last lecture. Planning in the real world Uncertainty This lecture Informal elements of probability “theory” Bayes’ rule and probabilistic inference Independence and conditional independence
E N D
Probabilistic Reasoning Introduction to Artificial Intelligence CS440/ECE448 Lecture 17
Last lecture • Planning in the real world • Uncertainty This lecture • Informal elements of probability “theory” • Bayes’ rule and probabilistic inference • Independence and conditional independence Reading • Chapters 13 and 14
The real world: Things go wrong Consider a plan for changing a tire after getting a flat using operators of RemoveTire(x), PutOnTire(x), InflateTire(x) • Incomplete information • Unknown preconditions, e.g., Is the spare actually intact? • Disjunctive effects, e.g., Inflating a tire with a pump may cause the tire to inflate or a slow hiss or the tire may burst or … • Incorrect information • Current state incorrect, e.g., spare NOT intact. • Missing/incorrect postconditions (effects) in operators. • Qualification problem: • can never finish listing all the required preconditions and possible conditional outcomes of actions.
Solutions • Conditional planning • Plan to obtain information (observation actions). • Subplan for each contingency, e.g., [Check(Tire1), [IF Intact(Tire1) THEN [Inflate(Tire1)] ELSE [CallAAA] ] • Expensive because it plans for many unlikely cases. • Monitoring/Replanning • Assume normal states, outcomes. • Check progress during execution, replan if necessary. • Unanticipated outcomes may lead to failure (e.g., no AAA card). • In general, some monitoring is unavoidable.
Probabilistic Reasoning Probabilistic assertions summarize effects of Ignorance: lack of relevant facts, initial conditions, etc. Laziness: failure to enumerate exceptions, qualifications, etc. Probability theory can be used to assert degrees of belief in the truth of propositions (things that can be true or false) given some state of knowledge: e.g., P(A135 gets me there on time | no reported accidents) = 0.06 Probabilities are NOT assertions about the world, but represent belief about whether the assertion is true. Probabilities of propositions change with new evidence: e.g., P(A135 gets me there on time| no reported accidents, 5 a.m.) = 0.15 (Analogous to logical entailment status; i.e., does KB |= .)
Making decisions under uncertainty • Suppose I believe the following: P(A 135 gets me there on time | ...) = 0.04 P(A 180 gets me there on time | ...) = 0.70 P(A 240 gets me there on time | ...) = 0.95 P(A 1440 gets me there on time | ...) = 0.9999 • 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 = utility theory + probability theory
Syntax • Basic element: random variable • Similar to propositional logic: possible worlds defined by assignment of values to random variables. • Boolean random variables e.g., Cavity (do I have a cavity?) is onw of <true,false> • Discrete random variables e.g., Weather is one of <sunny,rainy,cloudy,snow> • Domain values must be exhaustive and mutually exclusive. • Elementary proposition constructed by assignment of a value to a random variable e.g., Weather = sunny, Cavity = false (abbreviated as cavity) • Complex propositions e.g., Weather = sunny Cavity = false
Syntax (ctd.) • Atomic event: A complete specification of the state of the world about which the agent is uncertain. • E.g., if the world consists of only two Boolean variables Cavity and Toothache, then there are 4 distinct atomic events: Cavity = false Toothache = false Cavity = false Toothache = true Cavity = true Toothache = false Cavity = true Toothache = true • Atomic events are mutually exclusive and exhaustive
Axioms of probability For any propositions A, B • 0 P(A) 1 • P(True) = 1 and P(False) = 0 • P(A B) = P(A) + P(B) - P(A B)
Priors, Distributions Prior or unconditional probabilities of propositions e.g., P(cavity) =P(Cavity=true)= 0.1 P(Weather=sunny) = 0.72 P(cavity Weather=sunny) = 0.072 correspond to belief prior to arrival of any (new) evidence. Probability distribution gives probabilities of all possible values of the random variable. Weather is one of <sunny,rain,cloudy,snow> P(Weather) = <0.72, 0.1, 0.08, 0.1> (Normalized, i.e., sums to 1. Also note the bold font..)
Joint probability distribution Joint probability distribution for a set of variables gives values for each possible assignment to all the variables. P(Toothache, Cavity) is a 2 by 2 matrix. NOTE: Elements in table sum to 1 3 independent numbers. P(Weather,Cavity) is a 4 by 2 matrix of values: NOTE: Every question about a domain can be answered by the joint distribution
Conditional Probabilities • Conditional or posterior probabilities P(cavity | toothache) = P(Cavity=true | Toothache=true) = 0.8 What is the probability of having a cavity given that the patient has a toothache? • 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) [Note: Here a and b are unspecified random variables, thus designated with lowercase letters.]
Bayes Rule From the product rule P(a, b) = P(a|b)P(b) = P(b|a)P(a), we can derive Bayes' rule:
Bayes Rule: Example Let M be meningitis, and S be stiff neck, with P(m)=0.0001 P(s)= 0.1 P(s|m) = 0.8 Note: posterior probability of meningitis still very small!
A generalized Bayes Rule More general version conditionalized on some background evidence E:
Using the full joint distribution What is the unconditional probability of having a cavity? P(cavity) = P(cavity ^ toothache) + P(cavity^ ~toothache) = 0.04 + 0.06 = 0.1 What is the probability of having either a cavity or a toothache? P(cavity toothache) = P(cavity,toothache) + P(cavity, ~toothache) + P(~cavity,toothache) = 0.04 + 0.06 + 0.01 = 0.11
Using the full joint distribution What is the probability of having a cavity given that you already have a toothache?