Bayesian belief Network

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Bayesian belief Network

Moumita Ghosh
Assistant Professor
Dept of Information Technology
Definition
• Bayesian belief network is key computer technology for dealing with
probabilistic events and to solve a problem which has uncertainty. We
can define a Bayesian network as:
• "A Bayesian network is a probabilistic graphical model which
represents a set of variables and their conditional dependencies using
a directed acyclic graph."
• It is also called a Bayes network, belief network, decision network,
or Bayesian model.
• Bayesian networks are probabilistic, because these networks are built
from a probability distribution, and also use probability theory for
prediction and anomaly detection.
Real world Application
• Real world applications are probabilistic in nature, and to represent
the relationship between multiple events, we need a Bayesian
network. It can also be used in various tasks including prediction,
anomaly detection, diagnostics, automated insight, reasoning, time
series prediction, and decision making under uncertainty.
What is uncertainty with example..
• In a word uncertainty means which is not known in advance.
• Like tommorrows weather,
• If it is unknown whether or not it will rain tomorrow, then there is a
state of uncertainty. If probabilities are applied to the possible
outcomes using weather forecasts or even just a calibrated
probability assessment, the uncertainty has been quantified.
Parts of Bayesian network
• Bayesian Network can be used for building models from data and
experts’ opinions, and it consists of two parts:
• Directed Acyclic Graph
• Table of conditional probabilities.
• The generalized form of a Bayesian network that represents and
solves decision problems under uncertain knowledge is known as
an Influence diagram.
Representation
• A Bayesian network graph is made up of nodes and Arcs (directed
links), where:
• Each node corresponds to the random variables, and a
variable can be continuous or discrete.
• Arc or directed arrows represent the causal
relationship or conditional probabilities between
random variables. These directed links or arrows
connect the pair of nodes in the graph.
These links represent that one node directly influence
the other node, and if there is no directed link that
means that nodes are independent with each other
• In the above diagram, A, B, C, and D are random variables
represented by the nodes of the network graph.
• If we are considering node B, which is connected with
node A by a directed arrow, then node A is called the
parent of Node B.
• Node C is independent of node A.
Note: The Bayesian network graph does not contain any cyclic
graph. Hence, it is known as a directed acyclic graph or DAG.
Components of Bayesian network
• The Bayesian network has mainly two components:
• Causal Component
• Actual numbers
• Each node in the Bayesian network has condition probability
distribution P(Xi |Parent(Xi) ), which determines the effect of the
parent on that node.
• Bayesian network is based on Joint probability distribution and
conditional probability. So let's first understand the joint probability
distribution:
Joint Probability Distribution
Joint probability distribution:
• If we have variables x1, x2, x3,....., xn, then the probabilities of a
different combination of x1, x2, x3.. xn, are known as Joint probability
distribution.
• P[x1, x2, x3,....., xn], it can be written as the following way in terms of
the joint probability distribution.
= P[x1| x2, x3,....., xn]P[x2, x3,....., xn]
= P[x1| x2, x3,....., xn]P[x2|x3,....., xn]....P[xn-1|xn]P[xn].
In general it is written as:
• P(Xi|Xi-1,........., X1) = P(Xi |Parents(Xi ))
Problem 1

Example: Harry installed a new burglar alarm at his home to detect


burglary. The alarm reliably responds at detecting a burglary but also
responds for minor earthquakes. Harry has two neighbors David and
Sophia, who have taken a responsibility to inform Harry at work when
they hear the alarm. David always calls Harry when he hears the alarm,
but sometimes he got confused with the phone ringing and calls at that
time too. On the other hand, Sophia likes to listen to high music, so
sometimes she misses to hear the alarm. Here we would like to
compute the probability of Burglary Alarm.
Problem 1:
Calculate the probability that alarm
has sounded, but there is neither a
burglary, nor an earthquake
occurred, and David and Sophia
both called the Harry.
• Solution:
• The Bayesian network for the above problem is given below. The network
structure is showing that burglary and earthquake is the parent node of the alarm
and directly affecting the probability of alarm's going off, but David and Sophia's
calls depend on alarm probability.
• The network is representing that our assumptions do not directly perceive the
burglary and also do not notice the minor earthquake, and they also not confer
before calling.
• The conditional distributions for each node are given as conditional probabilities
table or CPT.
• Each row in the CPT must be sum to 1 because all the entries in the table
represent an exhaustive set of cases for the variable.
• In CPT, a boolean variable with k boolean parents contains 2K probabilities.
Hence, if there are two parents, then CPT will contain 4 probability values
• List of all events occurring Problem 1:
in this network: Calculate the probability that alarm
has sounded, but there is neither a
• Burglary (B) burglary, nor an earthquake
occurred, and David and Sophia
• Earthquake(E) both called the Harry.
• Alarm(A)
• David Calls(D)
• Sophia calls(S)
• We can write the events of problem statement in the form of
probability: P[D, S, A, B, E], can rewrite the above probability
statement using joint probability distribution:
• List of all events
• P[D, S, A, B, E]= P[D | S, A, B, E]. P[S, A, B, E] occurring in this
• =P[D | S, A, B, E]. P[S | A, B, E]. P[A, B, E] network:
• = P [D| A]. P [ S| A, B, E]. P[ A, B, E] • Burglary (B)
• = P[D | A]. P[ S | A]. P[A| B, E]. P[B, E] • Earthquake(E)
• Alarm(A)
• = P[D | A ]. P[S | A]. P[A| B, E]. P[B |E]. P[E]
• David Calls(D)
• Sophia calls(S)
• P(B= True) = 0.002, which is the probability of burglary.
• P(B= False)= 0.998, which is the probability of no burglary.
• P(E= True)= 0.001, which is the probability of a minor earthquake
• P(E= False)= 0.999, Which is the probability that an earthquake not
occurred.
• We can provide the conditional probabilities as per the below tables:
• From the formula of joint distribution, we can write the problem
statement in the form of probability distribution:
• P(S, D, A, ¬B, ¬E) = P (S|A) *P (D|A)*P (A|¬B ^ ¬E) *P (¬B) *P (¬E).
• = 0.75* 0.91* 0.001* 0.998*0.999 • List of all events
occurring in this
• = 0.00068045. network:
• Burglary (B)
Problem 1: • Earthquake(E)
Calculate the probability that alarm has sounded, but • Alarm(A)
there is neither a burglary, nor an earthquake occurred, • David Calls(D)
and David and Sophia both called the Harry. • Sophia calls(S)
Example 2
1.Exam Level (e) Case 1: Calculate the probability that in spite of
2.IQ Level (i) the exam level being difficult, the student having
3.Aptitude Score (s) a low IQ level and a low Aptitude Score, manages
4.Marks (m) to pass the exam and secure admission to the
university.
5.Admission (a)
Case 2: In another case, calculate the
probability that the student has a High IQ level
and Aptitude Score, the exam being easy yet
failing to pass and does not secure admission
to the university.
• In the above graph, we see several tables representing the probability
distribution values of the given 5 variables. These tables are called the
Conditional Probabilities Table or CPT. There are a few properties of
the CPT given below –
• The sum of the CPT values in each row must be equal to 1 because all
the possible cases for a particular variable are exhaustive
(representing all possibilities).
• If a variable that is Boolean in nature has k Boolean parents, then in
the CPT it has 2K probability values.
• Coming back to our problem, let us first list all the possible events
that are occurring in the above-given table.
• These five variables are represented in the form of a Directed Acyclic Graph
(DAG) in a Bayesian Network format with their Conditional Probability tables.
Now, to calculate the Joint Probability Distribution of the 5 variables the formula
is given by,
• P[a, m, i, e, s]= P(a | m) . P(m | i, e) . P(i) . P(e) . P(s | i)
• From the above formula,
• P(a | m) denotes the conditional probability of the student getting admission
based on the marks he has scored in the examination.
• P(m | i, e) represents the marks that the student will score given his IQ level and
difficulty of the Exam Level.
• P(i) and P(e) represent the probability of the IQ Level and the Exam Level.
• P(s | i) is the conditional probability of the student’s Aptitude Score, given his IQ
Level.
• Calculation of Joint Probability Distribution

• Let us now calculate the JPD for two cases.


• Case 1: Calculate the probability that in spite of the exam level being
difficult, the student having a low IQ level and a low Aptitude Score,
manages to pass the exam and secure admission to the university.
• From the above word problem statement, the Joint Probability
Distribution can be written as below,
• P[a=1, m=1, i=0, e=1, s=0]
Solution
From the above Conditional Probability tables, the values for the given conditions are fed to the formula and is
calculated as below.
P[a=1, m=1, i=0, e=0, s=0] = P(a=1 | m=1) . P(m=1 | i=0, e=1) . P(i=0) . P(e=1) . P(s=0 | i=0)
= 0.1 * 0.1 * 0.8 * 0.3 * 0.75
= 0.0018
• Case 2: In another case, calculate the probability that the student has a
High IQ level and Aptitude Score, the exam being easy yet fails to pass and
does not secure admission to the university.

• The formula for the JPD is given by


• P[a=0, m=0, i=1, e=0, s=1]
• Thus,
• P[a=0, m=0, i=1, e=0, s=1]= P(a=0 | m=0) . P(m=0 | i=1, e=0) . P(i=1) .
P(e=0) . P(s=1 | i=1)
• = 0.6 * 0.5 * 0.2 * 0.7 * 0.6
• = 0.0252

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy