Bayesian NetworkProbability Theory
Probability Space
- Sample space
- a set of all possible outcomes of a random experiment.
- Event
- an event is a subset of the sample space
.
- an event is a subset of the sample space
-algebra on sample space: - a collection of events for which it makes sense to assign probability, satisfies
- i. The empty set
is in ; - ii. The union of any set in
is also in ; - iii. If a set
is in , the complement is also in .
- i. The empty set
- a collection of events for which it makes sense to assign probability, satisfies
- A measurable event
- A measurable event
is a subset of the sample space, to which we are willing to assign probability. is an event that the randomly selected student is female. - Number of events:
where is the number of samples. - A measurable event that is an element of the
-algebra satisfies these three basic properties: - It contains empty event
, or say is in the -algebra. - [Closed under union] If
are measurable, then is measurable. Or say, the union of these events is in the -algebra. - [Closed under complementation] If
is measurable, then the complement is also measurable.
- It contains empty event
- A measurable event
Properties of Probability
Probability distribution
A Probability distribution
. Probabilities are nonnegative. , trivial event: all possible outcomes have the maximal probability of 1. Additivity: If
and are disjoint events , then The probability that one of the two mutually exclusive (disjoint) events will occur is the sum of the two, which also implies:
Example:
so
Key properties:
Monotonicity: If
, then . Intersection bound:
. Union bound:
. Complement rule:
. Law of total probability: If
are disjoint events such that , then:
A probability space
- A sample space
; - A
-algebra of measurable events; - A probability measure
.
Random variable
Random variable: is defined by a function associated with each outcome
Discrete random variables:
- Categorical (or discrete), e.g. gender, faculty.
- The probability mass function of a random variable
: Example: with properties: (countable unions of disjoint sets)
Continuous random variables:
Values in a given range, e.g. height, weight.
The probability density function (PDF):
, and: The cumulative distribution function (CDF):
Then we have
and . We have:
And note that:
For continuous random variables, the probability at a point is zero.
Domain of a random variable :
Example:
For any state
Multivariate probability
Multivariate Probability: Suppose there are two random variables
(a) A joint probability mass function
It describes the probability distribution of multiple variables together.
(b) Example: Students at university with random variables:
- Intelligence: low
, high - Scores: low
, high
Example table of joint distribution
Table 1: Joint distribution
The joint probability
i. The joint distribution
ii. In theory, one can answer any query about relations among the variables based on the joint distribution.
(c) Marginal distribution
It is obtained by summing out other variables from the joint distribution.
i. Query 1: Based on the joint distribution table, what is the probability of a randomly selected student being intelligent
| 0.665 | 0.06 | 0.725 | |
| 0.035 | 0.24 | 0.275 | |
| 0.7 | 0.3 | 1 |
Table 2: Table with joint and marginal distribution.
ii. Query 2: What is the probability that a random student has received low scores
Conditional Probability
Conditional Probability:
So the joint distribution can also be written as by rearranging the conditional probability definition formula:
(a) Query 3: What is the probability an intelligent student gets low scores? And what is the probability they get high scores?
Note that here intelligent student
Note that:
(b) Query 4: What is the probability a student got a high score is not intelligent?
Marginal Independence
Marginal Independence: An event
or
Alternative definition:
Intuitively,
For example:
(a) Query 5: Are intelligence and scores independent?
Actually,
It means knowing the intelligence gives us some knowledge about their scores, and vice versa.
Bayes’ theorem, inverse conditional probability
because:
Example 1: Medical Testing
Suppose a disease affects 1% of the population. We also have a test for this disease that is 99% accurate.
This means that if a person has the disease, the test will be positive 99% of the time, and if a person does not have the disease, the test will be negative 99% of the time.
Now, if a person tests positive, what is the probability that they actually have the disease?
This is not immediately obvious because, although the test is 99% accurate, the disease only affects 1% of the population. We can use Bayes' Theorem to find out.
Solution
- Let
be the event that the person has the disease, (or ) is the complement (does not have the disease). - Let
be the event that the person tests positive, and (or ) be the event that the person tests negative.
We want to find
- Prior distribution:
(marginal probability of ), the probability that a person has the disease is 1%. (conditional probability): The probability that the person tests positive given that they have the disease is 0.99 (because the test is 99% accurate).
Joint Probabilities:
Marginal Probability :
Posterior Distribution:
Finally, substitute into Bayes' theorem to find the posterior distribution:
Although the test is 99% accurate, a person who tests positive
Chain Rule
This is how we compute the joint probability. And it is the direct result of conditional probability.
and
If
which means:
Conditional Independence
(a) Two events
Then
Meaning:
(b) If we know
(c)
(d) Symmetry:
If
(e) Equivalent definition
Proposition
Proposition:
(a)
(b)
(c)
Exercise:
i. (a)
Expanding using the chain rule:
Simplify the equation:
So, rearranging this equation, we have (b).
ii. (a)
Expectation
Expectation
(a) Expectations: weighted average of discrete variables
(b) Properties:
i. Constant
ii. Linearity of expectation:
(c) Products of two variables:
i. If
(d) Conditional expectation
Variance
Variance: a measure of how concentrated the distribution of
(a) A variance is defined as
or
This is a very useful formula to compute the variance. Try to derive this using the properties of expectations!
(b) Properties:
i. Constant
ii. Quadratic scale
iii. If
(c) Standard deviation
a normalized measure of distance from the expectation.
Discrete Random Variables
(a) Bernoulli trials:
- 期望 (Mean):
- 方差 (Variance):
(b) Binomial distribution:
- 期望 (Mean):
- 方差 (Variance):
(c) Multinomial distribution:
with
- 期望 (Mean):
(其中 是第 i 个类别中的事件数量) - 方差 (Variance):
- 协方差 (Covariance):
(其中 ,表示不同类别之间的协方差)