Uncertainty-AI Download

Transcript
DEALING WITH UNCERTAINTY
(2)
WEEK 6
CHAPTER 3
1
Bayesian Approaches
 Bayesian
probability
is
one
of
the
different
interpretations
of
the
concept
of probability and belongs to the category of
evidential probabilities.
2
Bayesian Approaches
 derive the probability of an event given another event
 Often useful for diagnosis:




If X are (observed) effects and Y are (hidden) causes,
We may have a model for how causes lead to effects (P(X | Y))
We may also have prior beliefs (based on experience) about
the frequency of occurrence of effects (P(Y))
Which allows us to reason abductively from effects to causes
(P(Y | X)).
 has gained importance recently due to advances in
efficiency


more computational power available
better methods
3
Bayes’ Rule for Single Event
 single hypothesis H, single event E
P(H|E) = (P(E|H) * P(H)) / P(E)
or
 P(H|E) = (P(E|H) * P(H) /
(P(E|H) * P(H) + P(E|H) * P(H) )
4
 Bayes theorem gives us a way of calculating P(E|F) from a knowledge of P(F|E).
 Example
E = the event that an anabolic steroid detection test gives a positive result
F = the event that the athlete uses steroids

then
P(E|F) = probability that the test is positive for an athlete who uses steroids.
P(F|E) = probability that an athlete uses steroids given that the test is positive.
5
Example
 Two Boxes A & B. A has 3 red ball & 2 white ball,
while B has 2 red ball & 1 white ball. If we move
one ball from A to B then we chose a ball form A.
1.find the probability of chosen the red ball.
2.If the chosen ball was red, what is the propability for the moved ball
to be red.
6
1. find the probability of chosen the red ball.
 E1 : the moved ball is white
 E2 : the moved ball is red
 H : the chosen ball is red
P(H)=
P(H|E1)
+
P(H)= (2/5 * 1/4) +
P( H|E2)
(3/5 * 2/4)
P(H)= 2/20 + 6/20
P(H)= 0.40
7
1. If the chosen ball was red, what is the probability for the
moved ball to be red.
P(E2|H) = P ( E2  H) / P ( H)
P(E2|H) = (P(E2) * P(H/E2)) / P(H)
P(E2|H) = ( 3/5 * 2/4) / 0.65
P(E2|H) = 0.30 / 0.65
P(E2|H) = 5/13 Or 0.37
8
Advantages and Problems Of Bayesian
Reasoning
 advantages
 sound theoretical foundation
 well-defined semantics for decision making
 problems
 requires large amounts of probability data
 sufficient sample sizes
 subjective evidence may not be reliable
 independence of evidences assumption often not valid
 relationship between hypothesis and evidence is reduced to a
number
 explanations for the user difficult
 high computational overhead
9
Contents
10
Possibility theory: fuzzy sets and fuzzy logic
 Note that: Bayesian updating and certainty
theory - from statistical variations or
randomness.
 Possibility theory handles vagueness in the use
of language.
 Also called fuzzy logic
 Developed by Lotfi Zadeh.
 Builds upon his theory of fuzzy sets.
11
Conventional Set Theory
 In Conventional set theory:
 The Set Temperature = {high, medium, low}
 Elements of the set is mutually exclusive.


If a temperature value (say 300°C) is considered high, it cannot be
medium or low.
Values are crisp or non-fuzzy
 If the boundary between medium and high is 300°C, then


301°C is high
299°C is medium.
 This is a rather artificial distinction


A small change of 2°C from 299°C to 301°C completely change the
rule-firing
A huge change of 699°C from 301°C to 1000°C has no effect at all.
12
Crisp Set for temperature
13
Fuzzy Set
 Fuzzy sets smooth the boundaries.
 Fuzzy set theory expresses imprecision quantitatively
 Use characteristic membership functions with degrees of
membership from 0 (“not a member”) through to 1 (“a full
member”).
 For a fuzzy set F, the membership function μF (x)
measures the degree to which an absolute value x
belongs to F (possibility that x is described by F)
 The process of Getting the membership function or
deriving these possibility values for a given value of x
is called fuzzification.
14
Membership Function
 If we are given an imprecise statement that
the temperature is low.
 If LT is the fuzzy set of low temperatures, then we might
define the membership function μLT such that:
μLT (250°C) = 0.0
μLT (200°C) = 0.0
μLT (150°C) = 0.25
μLT (100°C) = 0.5
μLT (50°C) = 0.75
μLT (0°C) = 1.0
μLT (–50°C) = 1.0
15
Crisp vs Fuzzy Sets
 Fuzzy sets might be applied in handling
uncertainties caused by the use of vague
language.
 Examples of vague language phrases:



water level is low.
temperature is high.
pressure is high.
16
Fuzzy Set Example
membership
tall
short
medium
1
0.5
0
0
50
100
150
200
height
(cm)
250 17
Fuzzy vs. Crisp Set
membership
short
1
tall
medium
0.5
0
0
50
100
150
200
height
(cm)
250 18
Crisp Set vs Fuzzy Set
 The key characteristics of fuzzy sets (that makes
it different from crisp sets) are that:


an element has a degree of membership (0–1) of a
fuzzy set;
membership of one fuzzy set does not prevent
membership of another set
19
Fuzzy Set
 Temperature 350°C may have some (non-zero) degree
of membership to both fuzzy sets high and medium.
 This is represented by the overlap between the fuzzy
sets.
 Sum of the membership functions for a given value can
be arranged to equal 1.
350°C is 0.25 Medium
and 0.75 High
20
Terminologies
 Terminologies of fuzzy sets:



fuzzy set - low temperature
fuzzy variable - temperature
fuzzy statement - temperature is low
21
Crisp Rules vs Fuzzy Rules
CRISP RULES
FUZZY RULES
Variable value change in steps as
different rules fire.
Input variable values alter, causing
smooth changes in the outputs.
To smooth the steps require many
rules.
Require not as many rules.
(depends on the no. of variables, the
no. of fuzzy sets, and the ways in
which the variables are combined in
the fuzzy rule conditions).
Numerical information is explicit e.g
Numerical information is implicit in
the chosen shape of the fuzzy
membership functions.
22
Example
 Assume a rule base that contains the following fuzzy
rules:
/*
IF
/*
IF
/*
IF
Rule 3.6f */
temperature is high THEN pressure is high
Rule 3.7f */
temperature is medium THEN pressure is medium
Rule 3.8f */
temperature is low THEN pressure is low
 Suppose temperature is 350°C.
 This is a member of both fuzzy sets high and medium
 Rules 3.6f and 3.7f will both fire.
 The pressure, will be somewhat high
and somewhat medium.
23
 Using the membership functions for temperature given;
 the possibility that the temperature is high, μHT, is 0.75
 the possibility that the temperature is medium, μMT, is 0.25.
 As a result of firing the rules, the possibilities that the
pressure is high and medium, μHP and μMP, are set as
follows:
μ = max[μHT, μHP]
 μ = max[μMT, μMP]

HP
MP
24
 The initial possibility values for pressure are
assumed to be zero if these are the first rules to
fire, and thus µHP and µMP become 0.75 and
0.25, respectively.
 These values can be passed on to other rules
that might have pressure is high or pressure is
medium in their condition clauses.
25
Compound Conditions
 Rules 3.6f, 3.7f and 3.8f contain only simple
conditions.
 Fuzzy logic allows for compound conditions
similar to those in certainty theory discussed
earlier.
26
Example: AND Conjunction

Suppose water level has the fuzzy membership functions shown below

Suppose also that Rule 3.6f is redefined
as follows:
/* Rule 3.9f */
IF temperature is high AND water level is NOT low
THEN pressure is high
 For a water level of 1.2m,




the possibility of the water level being low, µLW(1.2m), is 0.6.
The possibility of the water level not being low is therefore 0.4.
As this is less than 0.75, the combined possibility for the
temperature being high and the water level not being low is 0.4.
Thus the possibility that the pressure is high, µHP, becomes 0.4
if it has not already been set to a higher value.
27
Example: OR Disjunction
 If several rules affect the same fuzzy set of the same
variable, they are equivalent to a single rule whose
conditions are joined by the disjunction OR.
 For example, these two rules:
/*
IF
/*
IF
Rule 3.6f */
temperature is high THEN pressure is high
Rule 3.10f */
water level is high THEN pressure is high
 are equivalent to this single rule:
/* Rule 3.11f */
IF temperature is high OR water level is high
THEN pressure is high
28
Dependent OR
 We can treat OR differently when it involves two fuzzy sets of the
same fuzzy variable, for example, high and medium temperature.
 In such cases, the memberships are clearly dependent on each other.
Therefore, we can introduce a new operator DOR for dependent OR.
 For example, given the rule:
/* Rule 3.12f */
IF temperature is low DOR temperature is medium
THEN pressure is lowish
 the combined possibility for the condition becomes:
29
Example DOR vs OR
 Given the fuzzy sets for temperature as below left, the combined possibility
would be the same for any temperature below 200°C, as shown below right.
This is consistent with the intended meaning of fuzzy Rule 3.12f.

If the OR operator had been used, the membership would dip between 0°C
and 200°C, with a minimum at 100°C, as shown below.
30

The problem


A temperature control system has four settings


Cold, Cool, Warm, and Hot
Humidity can be defined by:


Change the speed of a heater fan, based off the room
temperature and humidity.
Low, Medium, and High
Using this we can define
the fuzzy set.
Nonlinear and dynamic in nature
 Inputs for Intel Fuzzy ABS are derived from







Brake
4 WD
Feedback
Wheel speed
Ignition
Outputs
Pulsewidth
 Error lamp

Fuzzy rule-based system
 A Rule Base (RB) of fuzzy rules
 A Data Base (DB) of linguistic terms and their membership functions
 Together the RB and DB are the knowledge base (KB)
 A fuzzy inference system which maps from fuzzy inputs to a fuzzy output
 Fuzzification and defuzzification processes
33
34
FUZZIFICATION
 Fuzzification is the process of making a crisp quantity
fuzzy.
 In the real world, hardware such as a digital voltmeter
generates crisp data, but these data are subject to
experimental error.
35
FUZZIFICATION
 The fuzzification comprises the process of transforming
crisp values into grades of membership for linguistic terms
of fuzzy sets. The membership function is used to
associate a grade to each linguistic term.
36
 For the fuzzification of the car speed value X0=70 km/h the two
membership functions A and B from the Figure below can be
used, which characterize a low and a medium speed fuzzy set,
respectively. The given speed value of X0=70 km/h belongs with
a grade of A (X0)= 0.75 to the fuzzy set ``low'' and with a grade
of B (X0)= 0.25 to the fuzzy set ``medium''.
37
Example
 Measurement
devices in technical systems provide crisp
measurements, like 110.5 Volt or 31,5 °C. At first, these crisp values
must be transformed into linguistic terms (fuzzy sets) . This is
called fuzzification.
 The membership functions of the linguistic variable speed will be
determined below.
38
Defuzzification
 At 350°C  ( µHP = 0.75, µMP = 0.25, µLP = 0)
/*
IF
/*
IF
Rule 3.6f */
temperature is high THEN pressure is high
Rule 3.7f */
temperature is medium THEN pressure is medium

These values can be passed on to other rules that might have pressure is high or
pressure is medium in their condition clauses without any further manipulation.
 However, to interpret the membership values in numerical value of pressure, they
need to be defuzzified.
 Defuzzification is important especially if a control action must be performed like
“set current,” where a specific value setting is required.
39
Defuzzification
 Defuzzification takes place in two stages,
described below.

Stage 1: scaling the membership functions
 adjust
the fuzzy sets in accordance with the calculated
possibilities

Stage 2: finding the centroid
40
Defuzzification - Stage 1
 Larsen’s product operation rule - the membership functions are multiplied by
their respective possibility values. The effect is to compress the fuzzy sets so
that the peaks equal the calculated possibility values
 Alternative approach - truncate the fuzzy sets
41
Defuzzification - Stage 1
 For most shapes of fuzzy set, the difference between the
two approaches is small.
 But Larsen’s product operation rule has the advantages of
simplifying the calculations and allowing fuzzification
followed by defuzzification to return the initial value.
42
Defuzzification – Stage 2
 Centroid method


The most commonly used method
sometimes called the center of gravity, center of mass, or center of area
method.
 Defuzzified value = the point along the fuzzy variable axis that is the
centroid, or balance point, of all the scaled membership functions
taken together for that variable
Imagine the cut out from stiff card and
pasted together with overlap.
Defuzzified value = the balance point along
the fuzzy variable axis of this composite
shape.
When two membership functions overlap,
both overlapping regions contribute to the
mass of the composite shape.
43
Fuzzy Reasoning
 In order to implement a fuzzy reasoning system
you need

For each variable, a defined set of values for
membership
 Can
be numeric (1 to 10)
 Can be linguistic




really no, no, maybe, yes, really yes
tiny, small, medium, large, gigantic
good, okay, bad
And you need a set of rules for combining them
 Good
and bad = okay.
44
Advantages and Problems of Fuzzy
Logic
 advantages



general theory of uncertainty
wide applicability, many practical applications
natural use of vague and imprecise concepts
 helpful
for commonsense reasoning, explanation
 problems



membership functions can be difficult to find
multiple ways for combining evidence
problems with long inference chains
45
Uncertainty: Conclusions
 In AI we must often represent and reason about uncertain





information
This is no different from what people do all the time!
There are multiple approaches to handling uncertainty.
Probabilistic methods are most rigorous but often hard to
apply; Bayesian reasoning
Fuzzy logic provides an alternate approach which better
supports ill-defined or non-numeric domains.
Empirically, it is often the case that the main need is some
way of expressing "maybe". Any system which provides for
at least a three-valued logic tends to yield the same
decisions.
46