Download Probability and inference

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Choice modelling wikipedia , lookup

Discrete choice wikipedia , lookup

Transcript
Uncertainty
Chapter 13a
Chapter 13a
1
Uncertainty: 13.1
“Agents almost never have access to the whole truth about their
environment.”
• Sources of uncertainty:
- Laziness. It’s too much work to do all tests
- Theoretical ignorance. Limits of technology and computation.
- Practical ignorance. It may be impossibe/impractical to do all tests.
• Examples of practial ignorance
- partial observability (road state, other drivers’ plans, etc.)
- inaccurate traffic reports
- uncertainty in action outcomes (a flat tire could happen)
- immense complexity of modelling and predicting traffic
Chapter 13a
2
Rational decision under uncertainty: 13.1
• Rational decision under uncertainty depends on:
- Relative importance of goals
- Likelihood that goals will be met
• Example: Let action At = leave for airport t minutes before flight
- Will At get me there on time?
The likelihood of arriving on time depends on t and many
unknown factors. The agent can place these in a probabilistic framework
and choose t trading increased certainty about arriving on time with
the expenditure of a resource (the time needed to leave earlier).
• Another way to think about it:
Probabilistic assertions summarize effects of
- laziness: failure to enumerate exceptions, qualifications, etc.
- ignorance: lack of relevant facts, initial conditions, etc.
Chapter 13a
3
Making decisions under uncertainty: 13.1
• Suppose I believe the following:
P (A25
P (A90
P (A120
P (A1440
gets
gets
gets
gets
me
me
me
me
there
there
there
there
on
on
on
on
time| . . .)
time| . . .)
time| . . .)
time| . . .)
=
=
=
=
0.04
0.70
0.95
0.9999
• (Q) Which action should I choose, and why? • (Q) Which choice is the
rational one?
Chapter 13a
4
Decision-theoretic Agent: 13.1
• A Decision-theoretic agent chooses the action with the highest
expected utility (Not the one with the highest possible payout).
function DT-AGENT(percept) returns an action
static:
beliefState - probabilistic beliefs about current state
action - the agent’s action
Update beliefState based on action and percept
Calculate outcome probabilities for actions
given action descriptions and current beliefState.
Select action with the highest expected utility given
probabilities of outcomes and utility information.
return action
(Q) Write an equation for the expected utility of action a in belief state B?
(Q) Why should we choose the action with the best expected value?
(Q) Under what circumstances would a DT agent gamble or play the lottery?
Chapter 13a
5
Probability basics: 13.2
• Probabilities are applied to propositions
A proposition is an assertion that something is true or false.
• Random variable - function that maps to probabilistic values
- Boolean random variable: Cavity ∈ htrue, f alsei
- Discrete random variable: W eather ∈ hsunny, rainy, cloudy, snowi
- Continuous: Gaussian, Uniform distributions.
• Atomic events - a single point in the state space
- Example: cavity ∧ toothache, cavity ∧ ¬toothache
- Set of all atomic events is exhaustive (one of them is true)
- A proposition is equivalent to disjunction of related atomic events
cavity = (cavity ∧ toothache) ∨ (cavity ∧ ¬toothache)
Chapter 13a
6
Probability basics example: 13.2
• Rolling dice
- Sample space Ω has 6 possible roles. Each one is an atomic event.
• The probability of all atomic events sums to 1:
- P (1) + P (2) + P (3) + P (4) + P (5) + P (6) = 1.
Begin with a set Ω—the sample space
e.g., 6 possible rolls of a die.
ω ∈ Ω is an atomic event
An event A is any subset of Ω
P (A) = Σ{ω∈A}P (ω)
• The probability of an event is the sum of the probabilities of the atomic
events that go into it:
P (die roll < 4) = P (1) + P (2) + P (3) = 1/2
Chapter 13a
7
Rolling 2 dice
* If we roll 2 dice
(Q) How many atomic events are there
(Q) and what is the probability of each?
(Q) Answer the same 2 questions if we don’t care about the order in which
the dice are rolled.
(Q) Answer the same 2 questions if we consider the sum of the dice to be
an atomic event.
Chapter 13a
8
Propositions
• A proposition is an assertion that a particular event is true.
• A proposition can be written as the disjunction of atomic events
e.g., (a ∨ b) ≡ (¬a ∧ b) ∨ (a ∧ ¬b) ∨ (a ∧ b)
⇒ P (a ∨ b) = P (¬a ∧ b) + P (a ∧ ¬b) + P (a ∧ b)
(Q) Rewrite the proposition the roll is even as a disjunction of atomic events.
Chapter 13a
9
Syntax for propositions
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)
e.g., W eather is one of hsunny, rain, cloudy, snowi
W eather = rain is a proposition
Values must be exhaustive and mutually exclusive
Continuous random variables (bounded or unbounded)
e.g., T emp = 21.6; also allow, e.g., T emp < 22.0.
(Q) Write the proposition that it is either sunny or rainy?
Chapter 13a
10
Probability Axioms
Axioms true for all propositions;
1) All probabilities between 0 and 1:
0 ≤ P (a) ≤ 1
2) The probabilities of true and false propositions are 0 and 1:
P (true) = 1 P (f alse) = 0
3) The probability of a disjunction is given by:
P (a ∨ b) = P (a) + P (b) − P (a ∧ b)
(Q) Use the axioms to compute the probability that at least 1 of 2 rolled
dice is even.
Chapter 13a
11
Prior probability
Prior or unconditional probabilities of propositions
e.g., P (Cavity = true) = 0.1 and P (W eather = sunny) = 0.72
correspond to belief prior to arrival of any (new) evidence
Probability distribution gives values for all possible assignments:
P(W eather) = h0.72, 0.1, 0.08, 0.1i (normalized, i.e., sums to 1)
Joint probability distribution gives the probabiltiy for multiple things happening at the same time: P(W eather, Cavity) is a 4 × 2 matrix:
W eather = sunny rain cloudy snow
Cavity = true 0.144 0.02 0.016 0.02
Cavity = f alse 0.576 0.08 0.064 0.08
• Every question about a domain can be answered by the joint distribution.
(Q) What is the probability that it is sunny and Cavity=true?
(Q) What is the probability that it is sunny or Cavity=true?
Chapter 13a
12
Probability for continuous variables
Express distribution as a parameterized function of value:
P (X = x) = U [18, 26](x) = uniform density between 18 and 26
0.125
18
dx
26
P is a density; integrates to 1. P (X = 20.5) = 0.125 really means
limdx→0 P (20.5 ≤ X ≤ 20.5 + dx)/dx = 0.125
(Q) What is the probability of sampling exactly 20.6?
(Q) What is the probability of sampling between between 22 and 24?
Chapter 13a
13
Conditional probability
Conditional or posterior probabilities
e.g., P (cavity|toothache) = 0.8
i.e., given that toothache is all I know
NOT “if toothache then 80% chance of cavity”
Notation for conditional distributions:
P(Cavity|T oothache) = 2 × 2 table
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, e.g.,
P (cavity|toothache, 49ersW in) = P (cavity|toothache) = 0.8
Chapter 13a
14
Conditional probability
Definition of conditional probability:
P (a|b) =
P (a ∧ b)
if P (b) 6= 0
P (b)
Product rule gives an alternative formulation:
P (a ∧ b) = P (a|b)P (b) = P (b|a)P (a)
A general version holds for whole distributions, e.g.,
P(W eather, Cavity) = P(W eather|Cavity)P(Cavity)
(View as a 4 × 2 set of equations, not matrix mult.)
(Q) Draw this situation.
Chapter 13a
15