Lecture 21, Bayesian Networks Wrap Up Intro to Decision Theory Slide 1.

Slides:



Advertisements
Similar presentations
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Advertisements

Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) Nov, 28, 2012.
Dynamic Bayesian Networks (DBNs)
Reasoning Under Uncertainty: Bayesian networks intro Jim Little Uncertainty 4 November 7, 2014 Textbook §6.3, 6.3.1, 6.5, 6.5.1,
Slide 1 Reasoning Under Uncertainty: More on BNets structure and construction Jim Little Nov (Textbook 6.3)
Decision Making Under Uncertainty Jim Little Decision 1 Nov
CPSC 502, Lecture 11Slide 1 Introduction to Artificial Intelligence (AI) Computer Science cpsc502, Lecture 11 Oct, 18, 2011.
Planning under Uncertainty
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) March, 16, 2009.
Decision Theory: Single Stage Decisions Computer Science cpsc322, Lecture 33 (Textbook Chpt 9.2) March, 30, 2009.
Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) April, 1, 2009.
CPSC 322, Lecture 30Slide 1 Reasoning Under Uncertainty: Variable elimination Computer Science cpsc322, Lecture 30 (Textbook Chpt 6.4) March, 23, 2009.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
CPSC 322, Lecture 28Slide 1 Reasoning Under Uncertainty: More on BNets structure and construction Computer Science cpsc322, Lecture 28 (Textbook Chpt 6.3)
5/25/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 16, 6/1/2005 University of Washington, Department of Electrical Engineering Spring 2005.
CPSC 322, Lecture 31Slide 1 Probability and Time: Markov Models Computer Science cpsc322, Lecture 31 (Textbook Chpt 6.5) March, 25, 2009.
CPSC 322, Lecture 32Slide 1 Probability and Time: Hidden Markov Models (HMMs) Computer Science cpsc322, Lecture 32 (Textbook Chpt 6.5) March, 27, 2009.
CPSC 422, Lecture 18Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 18 Feb, 25, 2015 Slide Sources Raymond J. Mooney University of.
CPSC 322, Lecture 29Slide 1 Reasoning Under Uncertainty: Bnet Inference (Variable elimination) Computer Science cpsc322, Lecture 29 (Textbook Chpt 6.4)
CPSC 322, Lecture 24Slide 1 Reasoning under Uncertainty: Intro to Probability Computer Science cpsc322, Lecture 24 (Textbook Chpt 6.1, 6.1.1) March, 15,
CPSC 422 Lecture 2 Review of Bayesian Networks, Representational Issues.
Reasoning Under Uncertainty: Independence and Inference Jim Little Uncertainty 5 Nov 10, 2014 Textbook §6.3.1, 6.5, 6.5.1,
Department of Computer Science Undergraduate Events More
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Bayesian networks. Motivation We saw that the full joint probability can be used to answer any question about the domain, but can become intractable as.
Baye’s Rule.
Logic: Intro & Propositional Definite Clause Logic CPSC 322 – Logic 1 Textbook §5.1 March 4, 2011.
CPSC 322, Lecture 32Slide 1 Probability and Time: Hidden Markov Models (HMMs) Computer Science cpsc322, Lecture 32 (Textbook Chpt 6.5.2) Nov, 25, 2013.
Reasoning Under Uncertainty: Conditioning, Bayes Rule & the Chain Rule Jim Little Uncertainty 2 Nov 3, 2014 Textbook §6.1.3.
CPSC 322, Lecture 28Slide 1 More on Construction and Compactness: Compact Conditional Distributions Once we have established the topology of a Bnet, we.
Lecture 33, Bayesian Networks Wrap Up Intro to Decision Theory Slide 1.
CPSC 422, Lecture 11Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11 Oct, 2, 2015.
Computer Science CPSC 502 Lecture 9 (up-to Ch )
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
Reasoning Under Uncertainty: Independence and Inference CPSC 322 – Uncertainty 5 Textbook §6.3.1 (and for HMMs) March 25, 2011.
CPSC 322, Lecture 2Slide 1 Representational Dimensions Computer Science cpsc322, Lecture 2 (Textbook Chpt1) Sept, 7, 2012.
Probabilistic Robotics Introduction Probabilities Bayes rule Bayes filters.
Bayes network inference  A general scenario:  Query variables: X  Evidence (observed) variables and their values: E = e  Unobserved variables: Y 
Domain Splitting, Local Search CPSC 322 – CSP 4 Textbook §4.6, §4.8 February 4, 2011.
Decision Theory: Single & Sequential Decisions. VE for Decision Networks. CPSC 322 – Decision Theory 2 Textbook §9.2 April 1, 2011.
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) Nov, 13, 2013.
Uncertainty: Wrap up & Decision Theory: Intro Alan Mackworth UBC CS 322 – Decision Theory 1 March 25, 2013 Textbook §6.4.1 & §9.2.
Reasoning Under Uncertainty: Variable Elimination for Bayes Nets Jim Little Uncertainty 6 Nov Textbook §6.4,
Reasoning Under Uncertainty: Variable Elimination CPSC 322 – Uncertainty 6 Textbook §6.4.1 March 28, 2011.
Example: Localization for “Pushed around” Robot
Reasoning Under Uncertainty: Belief Networks
Reasoning Under Uncertainty: More on BNets structure and construction
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Chapter 10 (part 3): Using Uncertain Knowledge
Reasoning Under Uncertainty: More on BNets structure and construction
Reasoning Under Uncertainty: Conditioning, Bayes Rule & Chain Rule
Planning Under Uncertainty Computer Science cpsc322, Lecture 11
& Decision Theory: Intro
Decision Theory: Single Stage Decisions
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Probability and Time: Markov Models
Reasoning Under Uncertainty: Bnet Inference
Probability and Time: Markov Models
Probability Topics Random Variables Joint and Marginal Distributions
Decision Theory: Single & Sequential Decisions.
Decision Theory: Sequential Decisions
Reasoning Under Uncertainty: Bnet Inference
Decision Theory: Single Stage Decisions
Probability and Time: Markov Models
Reasoning Under Uncertainty: Bnet Inference
Probability and Time: Markov Models
Domain Splitting CPSC 322 – CSP 4 Textbook §4.6 February 4, 2011.
Reasoning Under Uncertainty: Variable elimination
Presentation transcript:

Lecture 21, Bayesian Networks Wrap Up Intro to Decision Theory Slide 1

Announcements Practice Exercises on Bnets– 6a, 6b and 6c –Reminder: they are helpful for staying on top of the material, and for studying for the exam 2

Lecture Overview Recap Bnes Wrap up: simplified structures Intro to Decision theory Utility and expected utility Single-stage decision problems Decision networks 3

XYZval ttt0.1 ttf0.9 tft0.2 tff0.8 ftt0.4 ftf0.6 fft0.3 fff0.7 Factors A factor f(X 1,…,X j ) is a function from a tuple of random variables X 1,…,X j to the real numbers R A factor denotes one or more (possibly partial) distributions over the given tuple of variables, e.g., P(X 1, X 2 ) is a factor f(X 1, X 2 ) P(Z | X,Y) is a factor f(Z,X,Y) P(Z=f|X,Y) is a factor f(X,Y) Note: Factors do not have to sum to one Distribution Set of Distributions One for each combination of values for X and Y Set of partial Distributions f(X, Y ) Z = f 4

Recap If we assign variable A=a in factor f (A,B), what is the correct form for the resulting factor? –f(B). When we assign variable A we remove it from the factor’s domain If we marginalize variable A out from factor f (A,B), what is the correct form for the resulting factor? –f(B). When we marginalize out variable A we remove it from the factor’s domain If we multiply factors f 4 (X,Y) and f 6 (Z,Y), what is the correct form for the resulting factor? –f(X,Y,Z) –When multiplying factors, the resulting factor’s domain is the union of the multiplicands’ domains 5

The variable elimination algorithm, 1.Construct a factor for each conditional probability. 2.For each factor, assign the observed variables E to their observed values. 3.Given an elimination ordering, decompose sum of products 4.Sum out all variables Z i not involved in the query (one a time) Multiply factors containing Z i Then marginalize out Z i from the product 5.Multiply the remaining factors (which only involve Y ) 6. Normalize by dividing the resulting factor f(Y) by To compute P(Y=y i | E 1 =e 1, …, E j =e j ) = The JPD of a Bayesian network is Given: P(Y, E 1 …, E j, Z 1 …,Z k ) observed Other variables not involved in the query

The variable elimination algorithm, 1.Construct a factor for each conditional probability. 2.For each factor, assign the observed variables E to their observed values. 3.Given an elimination ordering, decompose sum of products 4.Sum out all variables Z i not involved in the query (one a time) Multiply factors containing Z i Then marginalize out Z i from the product 5.Multiply the remaining factors (which only involve Y ) 6. Normalize by dividing the resulting factor f(Y) by To compute P(Y=y i | E 1 =e 1, …, E j =e j ) = The JPD of a Bayesian network is Given: P(Y, E 1 …, E j, Z 1 …,Z k ) observed Other variables not involved in the query

Step 1: Construct a factor for each cond. probability P(G,H) =  A,B,C,D,E,F,I P(A)P(B|A)P(C)P(D|B,C)P(E|C)P(F|D)P(G|F,E)P(H|G)P(I|G) P(G,H) =  A,B,C,D,E,F,I f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G) Compute P(G | H=h 1 ). 8

Previous state: P(G,H) =  A,B,C,D,E,F,I f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G) Observe H : Step 2: assign to observed variables their observed values. P(G,H=h 1 )=  A,B,C,D,E,F,I f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 9 (G) f 8 (I,G) Compute P(G | H=h 1 ). 9

Step 3: Decompose sum of products Previous state: P(G,H=h 1 ) =  A,B,C,D,E,F,I f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 9 (G) f 8 (I,G) Elimination ordering A, C, E, I, B, D, F : P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B  I f 8 (I,G)  E f 6 (G,F,E)  C f 2 (C) f 3 (D,B,C) f 4 (E,C)  A f 0 (A) f 1 (B,A) Compute P(G | H=h 1 ). 10

Step 4: sum out non query variables (one at a time) Previous state: P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B  I f 8 (I,G)  E f 6 (G,F,E)  C f 2 (C) f 3 (D,B,C) f 4 (E,C)  A f 0 (A) f 1 (B,A) Eliminate A: perform product and sum out A in P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B)  I f 8 (I,G)  E f 6 (G,F,E)  C f 2 (C) f 3 (D,B,C) f 4 (E,C) Elimination order: A,C,E,I,B,D,F Compute P(G | H=h 1 ). f 10 (B) does not depend on C, E, or I, so we can push it outside of those sums. 11

Step 4: sum out non query variables (one at a time) Previous state: P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B)  I f 8 (I,G)  E f 6 (G,F,E)  C f 2 (C) f 3 (D,B,C) f 4 (E,C) Eliminate C: perform product and sum out C in P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B)  I f 8 (I,G)  E f 6 (G,F,E) f 11 (B,D,E) Compute P(G | H=h 1 ). Elimination order: A,C,E,I,B,D,F

Step 4: sum out non query variables (one at a time) Previous state: P(G,H=h 1 ) = P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B)  I f 8 (I,G)  E f 6 (G,F,E) f 11 (B,D,E) Eliminate E: perform product and sum out E in P(G,H=h 1 ) = P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B) f 12 (B,D,F,G)  I f 8 (I,G) Compute P(G | H=h 1 ). Elimination order: A,C,E,I,B,D,F 13

Previous state: P(G,H=h 1 ) = P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B) f 12 (B,D,F,G)  I f 8 (I,G) Eliminate I: perform product and sum out I in P(G,H=h 1 ) = P(G,H=h 1 ) = f 9 (G) f 13 (G)  F  D f 5 (F, D)  B f 10 (B) f 12 (B,D,F,G) Elimination order: A,C,E,I,B,D,F Step 4: sum out non query variables (one at a time) Compute P(G | H=h 1 ). 14

Previous state: P(G,H=h 1 ) = P(G,H=h 1 ) = f 9 (G) f 13 (G)  F  D f 5 (F, D)  B f 10 (B) f 12 (B,D,F,G) Eliminate B: perform product and sum out B in P(G,H=h 1 ) = P(G,H=h 1 ) = f 9 (G) f 13 (G)  F  D f 5 (F, D) f 14 (D,F,G) Elimination order: A,C,E,I,B,D,F Step 4: sum out non query variables (one at a time) Compute P(G | H=h 1 ). 15

Previous state: P(G,H=h 1 ) = P(G,H=h 1 ) = f 9 (G) f 13 (G)  F  D f 5 (F, D) f 14 (D,F,G) Eliminate D: perform product and sum out D in P(G,H=h 1 ) = P(G,H=h 1 ) = f 9 (G) f 13 (G)  F f 15 (F,G) Elimination order: A,C,E,I,B,D,F Step 4: sum out non query variables (one at a time) Compute P(G | H=h 1 ). 16 Multiply remaining factors (all in G): P(G,H=h 1 ) = f 17 (G)

Previous state: P(G,H=h 1 ) = P(G,H=h 1 ) = f 9 (G) f 13 (G)  F f 15 (F,G) Eliminate F: perform product and sum out F in P(G,H=h 1 ) = f 9 (G) f 13 (G)f 16 (G) Elimination order: A,C,E,I,B,D,F Step 4: sum out non query variables (one at a time) Compute P(G | H=h 1 ). 17 Multiply remaining factors (all in G): P(G,H=h 1 ) = f 17 (G) Normalize

Variable elimination: pruning Slide 18  Thus, if the query is P(G=g| C=c 1, F=f 1, H=h 1 ) we only need to consider this subnetwork We can also prune unobserved leaf nodes Since they are unobserved and not predecessors of the query nodes, they cannot influence the posterior probability of the query nodes 18 Before running VE, we can prune all variables Z that are conditionally independent of the query Y given evidence E: Z ╨ Y | E –They cannot change the belief over Y given E!

VE in AISpace To see how variable elimination works in the Aispace Applet Select “Network options -> Query Models > verbose” Compare what happens when you select “Prune Irrelevant variables” or not in the VE window that pops up when you query a node Try different heuristics for elimination ordering 19

20 Query P(A given L=F,S=T)

Complexity of Variable Elimination (VE) A factor over n binary variables has to store 2 n numbers –The initial factors are typically quite small (variables typically only have few parents in Bayesian networks) –But variable elimination constructs larger factors by multiplying factors together The complexity of VE is exponential in the maximum number of variables in any factor during its execution –This number is called the treewidth of a graph (along an ordering) –Elimination ordering influences treewidth Finding the best ordering is NP complete –I.e., the ordering that generates the minimum treewidth –Heuristics work well in practice (e.g. least connected variables first) –Even with best ordering, inference is sometimes infeasible In those cases, we need approximate inference. See CS422 & CS540 Simplified network structures can help 21

Lecture Overview Recap Bnes Wrap up: simplified structures Intro to Decision theory Utility and expected utility Single-stage decision problems Decision networks 22

Very Popular Application  Naïve Bayes models: very simple Bayesian networks for classification Class variable (to be predicted) is the root node Attribute variables X i (observations) are the leaves  Naïve because it assumes that the attributes are conditionally independent of each other given the class  Deterministic prediction can be obtained by picking the most likely class  Scales up really well: with n boolean attributes we just need……. C X1X1 XiXi X2X2

Very Popular Application  Naïve Bayes models: very simple Bayesian networks for classification Class variable (to be predicted) is the root node Attribute variables X i (observations) are the leaves  Naïve because it assumes that the attributes are conditionally independent of each other given the class  Deterministic prediction can be obtained by picking the most likely class  Scales up really well: with n boolean attributes we just need 2n+1 parameters C X1X1 XiXi X2X2

Example  Naïve Classifier agent that needs to predict whether to recommend a newsgroup post for reading to its user

Example  Naïve Classifier for agent that needs to predict the user’s emotion during interaction

Canonical Probability Distributions  CPT grows exponentially with number of parents  Possible solution: canonical distributions that are defined compactly  Example: Noisy-OR distribution Models multiple non-interacting causes Logic OR with a probabilistic twist. In Propositional logic, we can define the following rule: Fever is TRUE if and only if Malaria, Cold or Flue are true The Noisy-OR model allows for uncertainty in the ability of each cause to generate the effect (i.e. one may have a cold without a fever) Malaria Fever Cold  Two assumptions 1.All possible causes a listed 2.For each of the causes, whatever inhibits it to generate the target effect is independent from the inhibitors of the other causes Flu

Noisy-OR  Parent nodes U 1,…,U k include all causes but I can always add a “dummy” cause, or leak to cover for left-out causes  For each of the causes, whatever inhibits it to generate the target effect is independent from the inhibitors of the other causes Independent probability of failure q i for each cause alone: P(⌐Effect| u i ) = q i P(⌐Effect| u 1,.. u j, ⌐ u j+1,., ⌐ u k ) = ∏ j i=1 P(⌐Effect| u i ) = ∏ j i=1 q i P(Effect| u 1,.. u j, ⌐ u j+1,., ⌐ u k ) = 1 - ∏ j i=1 q i U1U1 Effect UkUk LEAK

Example  P(⌐fever| cold, ⌐ flu, ⌐ malaria ) = 0.6  P(⌐fever| ⌐ cold, flu, ⌐ malaria ) = 0.2  P(⌐fever| ⌐ cold, ⌐ flu, malaria ) = 0.1 Malaria

Example  Note that we did not have a Leak node in this example, for simplicity, but it would have been useful since Fever can definitely be caused by reasons other than the three we had  If we include it, how does the CPT change? ColdFluMalariaLeakP(Fever)P(⌐Fever) FFFF FFFT FFTF FFTT FTFF FTFT FTTF FTTT TFFF TFFT TFTF T ………… F ………… T ………… T …………

Hidden Variables  Variables that can’t or won’t be observed, but are added to ensure sparse structure and reduce parameters  Let’s consider a diagnostic problem (e.g. “why my car does not start?”) Possible causes (orange nodes below) of observations of interest (e.g., “car won’t start”) Other “observable nodes” that I can test to assess causes (green nodes below) “Hidden variables” (grey nodes)

More on hidden variables  Hidden variables that can‘t be observed may affect the direction of the dependencies that need to be represented in the network structure  Example: representing a domain for an intelligent system that acts as a tutor (aka Intelligent Tutoring System, or ITS) Topics divided in sub-topics Student knowledge of a topic depends on student knowledge of its sub- topics We can never observe student knowledge directly, we can only observe it indirectly via student test answers

Two Ways of Representing Knowledge Overall Proficiency Topic 1 Sub-topic 1.1 Answer 3 Answer 4 Sub-topic 1.2 Answer 2Answer 1 Answer 3 Answer 4 Answer 2Answer 1 Sub-topic 1.1Sub-topic 1.2 Overall Proficiency Topic 1 Which one should I pick?

Two Ways of Representing Knowledge Change in probability for a given node always propagates to its siblings, because we never get direct evidence on knowledge Change in probability for a given node does not propagate to its siblings, because we never get direct evidence on knowledge Overall Proficiency Topic 1 Sub-topic 1.1 Answer 3 Answer 4 Sub-topic 1.2 Answer 2Answer 1 Answer 3 Answer 4 Answer 2Answer 1 Sub-topic 1.1 Sub-topic 1.2 Overall Proficiency Topic 1 Answer 1 Which one you want to chose depends on the domain you want to represent

Build a Bayesian Network for a given domain Identify the necessary CPTs Compare different network structures Understand dependencies and independencies Variable elimination –Understating factors and their operations –Carry out variable elimination by using factors and the related operations –Use techniques to simplify variable elimination Explain what is a Noisy-Or configuration, the assumptions behind it, and why it is useful Explain what is a Naïve-Bayes configuration and the assumptions behind it, and why it is useful Learning Goals For Bnets 35

Bioinformatics Big picture: Reasoning Under Uncertainty Dynamic Bayesian Networks Hidden Markov Models & Filtering Probability Theory Bayesian Networks & Variable Elimination Natural Language Processing spam filters Motion Tracking, Missile Tracking, etc Monitoring (e.g. credit card fraud detection) Diagnostic systems (e.g. medicine, ITS) 36

Where are we? Environment Problem Type Query Planning Deterministic Stochastic Constraint Satisfaction Search Arc Consistency Search Logics STRIPS Vars + Constraints Variable Elimination Belief Nets Decision Nets Static Sequential Representation Reasoning Technique Variable Elimination This concludes the module on answering queries in stochastic environments

What’s Next? Environment Problem Type Query Planning Deterministic Stochastic Constraint Satisfaction Search Arc Consistency Search Logics STRIPS Vars + Constraints Variable Elimination Belief Nets Decision Nets Static Sequential Representation Reasoning Technique Variable Elimination Now we will look at acting in stochastic environments

Lecture Overview Recap Bnes Wrap up: simplified structures Intro to Decision theory Utility and expected utility Single-stage decision problems Decision networks 39

Decisions Under Uncertainty: Intro Earlier in the course, we focused on decision making in deterministic domains –Planning Now we face stochastic domains –so far we've considered how to represent and update beliefs –what if an agent has to make decisions (act) under uncertainty? Making decisions under uncertainty is important –We represent the world probabilistically so we can use our beliefs as the basis for making decisions 40

Decisions Under Uncertainty: Intro An agent's decision will depend on –What actions are available –What beliefs the agent has –Which goals the agent has Differences between deterministic and stochastic setting –Obvious difference in representation: need to represent our uncertain beliefs –Actions will be pretty straightforward: represented as decision variables –Goals will be interesting: we'll move from all-or-nothing goals to a richer notion: rating how happy the agent is in different situations. –Putting these together, we'll extend Bayesian Networks to make a new representation called Decision Networks 41

Delivery Robot Example Robot needs to reach a certain room Robot can go the short way - faster but with more obstacles, thus more prone to accidents that can damage the robot and prevent it from reaching the room the long way - slower but less prone to accident Which way to go? Is it more important for the robot to arrive fast, or to minimize the risk of damage? The Robot can choose to wear pads to protect itself in case of accident, or not to wear them. Pads make it heavier, increasing energy consumption Again, there is a tradeoff between reducing risk of damage, saving resources and arriving fast Possible outcomes No pad, no accident Pad, no accident Pad, Accident No pad, accident

Next We’ll see how to represent and reason about situations of this nature using Decision Trees, as well as Probability to measure the uncertainty in action outcome Utility to measure agent’s preferences over the various outcomes Combined in a measure of expected utility that can be used to identify the action with the best expected outcome Best that an intelligent agent can do when it needs to act in a stochastic environment

Decision Tree for the Delivery Robot Example Decision variable 1: the robot can choose to wear pads –Yes: protection against accidents, but extra weight –No: fast, but no protection Decision variable 2: the robot can choose the way –Short way: quick, but higher chance of accident –Long way: safe, but slow Random variable: is there an accident? Agent decides Chance decides 44

Delivery Robot Example Decision variable 1: the robot can choose to wear pads –Yes: protection against accidents, but extra weight –No: fast, but no protection Decision variable 2: the robot can choose the way –Short way: quick, but higher chance of accident –Long way: safe, but slow Random variable: is there an accident? Agent decides Chance decides 45

Possible worlds and decision variables A possible world specifies a value for each random variable and each decision variable For each assignment of values to all decision variables –the probabilities of the worlds satisfying that assignment sum to

Possible worlds and decision variables A possible world specifies a value for each random variable and each decision variable For each assignment of values to all decision variables –the probabilities of the worlds satisfying that assignment sum to 1.

Possible worlds and decision variables A possible world specifies a value for each random variable and each decision variable For each assignment of values to all decision variables –the probabilities of the worlds satisfying that assignment sum to 1.

Possible worlds and decision variables A possible world specifies a value for each random variable and each decision variable For each assignment of values to all decision variables –the probabilities of the worlds satisfying that assignment sum to 1.

Lecture Overview Recap Intro to Decision theory Utility and expected utility Single-stage decision problems Decision networks 50

Utility Utility: a measure of desirability of possible worlds to an agent –Let U be a real-valued function such that U(w) represents an agent's degree of preference for world w –Expressed by a number in [0,100] 51

Utility for the Robot Example Which would be a reasonable utility function for our robot? Which are the best and worst scenarios? Utility probability

Utility for the Robot Example Which would be a reasonable utility function for our robot? Utility probability

Utility: Simple Goals –How can the simple (boolean) goal “reach the room” be specified? Which way Accident Wear PadsUtility long true true long true false long false true long false false short true true short true false short false true short false false B. A. C. D. Not possible Which way Accident Wear PadsUtility long true true long true false long false true long false false short true true short true false short false true short false false Which way Accident Wear PadsUtility long true true long true false long false true long false false short true true short true false short false true short false false

Utility Utility: a measure of desirability of possible worlds to an agent –Let U be a real-valued function such that U(w) represents an agent's degree of preference for world w –Expressed by a number in [0,100] Simple goals can still be specified –Worlds that satisfy the goal have utility 100 –Other worlds have utility 0 55 Which way Accident Wear PadsUtility long true true long true false long false true long false false short true true short true false short false true short false false e.g., goal “reach the room”

Optimal decisions: combining Utility and Probability Each set of decisions defines a probability distribution over possible outcomes Each outcome has a utility For each set of decisions, we need to know their expected utility –the value for the agent of achieving a certain probability distribution over outcomes (possible worlds) The expected utility of a set of decisions is obtained by weighting the utility of the relevant possible worlds by their probability We want to find the decision with maximum expected utility value of this scenario?

Expected utility of a decision Utility probability E[U|D] The expected utility of decision D = d i is What is the expected utility of Wearpads=yes, Way=short ? E (U | D = d i ) =  w╞ (D = d i ) P( w ) U( w ) A. 7 B. 83 C. 76 D

Expected utility of a decision Utility probability E[U|D] The expected utility of decision D = d i is What is the expected utility of Wearpads=yes, Way=short ? E (U | D = d i ) =  w╞ (D = d i ) P( w ) U( w ) 0.2 * * 95 = 83

Expected utility of a decision Utility probability E[U|D] The expected utility of decision D = d i is E (U | D = d i ) =  w╞ (D = d i ) P( w ) U( w )

Lecture Overview Recap Intro to Decision theory Utility and expected utility Single-stage decision problems – NEXT TIME Decision networks 60