Introduction to Bayesian Statistics and Networks

Download Report

Transcript Introduction to Bayesian Statistics and Networks

Programming for
Geographical Information Analysis:
Advanced Skills
Online mini-lecture: Introduction to Bayesian
statistics and networks
Dr Andy Evans
Bayesian Networks
Of course, it may be that we see people in one
state, and their actions, but have no way of
replicating the rulesets in human language.
In this case, we can generate a Bayesian
Network.
These gives probabilities that states will
occur together.
They allow you to update the probabilities
on new evidence.
They allow you to chain these “rules”
together to make inferences.
Bayesian Networks
The probability of an event A is equal to the probability of A
given some other event B, plus the probability of A given B
doesn’t happen.
P(A) = P(AB) + P(ABc)
P(A) = P(A|B)P(B) + P(A|Bc)P(Bc)
1 – P(B)
Where A|B is the probability of A happening, given B
Bayesian Networks
For example, say we want to predict the likelihood we have a
republican (“GOP”) president starting a war.
We can calculate the likelihood of a war…
P(War) = P(WarGvnGOP)P(GOP) + P(WarGvnDemocrat)P(Democrat)
0.70 = 0.66 * 0.64 + 0.76 * 0.36
Bayesian Networks
Equally, though the probability of an event happening, given
some other event, is the probability of both events
happening, divided by the probability of the other event
happening.
P (B|A) = P(BA) / P(A)
P (B|A) = P(B)P(A|B)/P(A)
If we have “A” we can use this to calculate B given A.
Bayesian Networks
For example, if we have a war, we can use this to calculate the
probability we also have a republican president.
P(GOPGvnWar) = P(GOP)P(WarGvnGOP)/P(War)
0.6 = (0.64 * 0.66) / 0.7
If a war occurred, we know the probability of that happening, which
means we can plug it into the equation to get the probability we
have a GOP president. If we’re having a war, and we can also use
this as the P(GOP) to calculate the probability of another war:
P(War) = P(WarGvnGOP)P(GOP) + P(WarGvnDemocrat)P(Democrat)
Bayesian statistics
Or, more generally…
Pr(Bx|A) = Pr(Bx)Pr(A|Bx)
ΣPr(Bi)Pr(A|Bi)
Pr(GOPGvnWAR) =Pr(GOP)Pr(WARGvnGOP)
ΣPr(CAUSES)Pr(WARGvnCAUSES)
Pr(A)
Where Bi is all the potential causes (or things that must happen in
order for A to occur) and Bx is the specific thing we are testing for.
ie. Pr(B|A) = Probability of possible Cause B given A.
Pr(A|B) = Probability of A given possible Cause B.
Uses
Bayesian stats used to control:
Help systems.
Amazon recommendations.
Given a series of situations, and previous responses, what is the likelihood
of a response being needed given this situation.
Also, other types of systems that learn solutions and predict
answers: i.e. AI.
Possible uses:
Flood gate control.
Land use planning.
Policy making.
Bayesian Networks
In a Bayesian Network the states are linked by probabilities,
so:
If A then B; if B then C; if C then D
Not only this, but this can be updated when an event A
happens, propagating the new probabilities by using the new
final probability of B to recalculate the probability of C, etc.
Expert Systems
All these elements may be brought together in an “Expert
System”.
These are decision trees, in which rules and probabilities link
states.
Forward chaining: you input states and the system runs
through the rules to suggest a most scenario of action.
Backward chaining: you input goals, and the system tells you
the states you need to achieve to get there.
Don’t have to use Fuzzy Sets or Bayesian probabilities, but
often do.