Misplaced Pages

Conditional probability table

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Conditional probability table" – news · newspapers · books · scholar · JSTOR (December 2013) (Learn how and when to remove this message)

In statistics, the conditional probability table (CPT) is defined for a set of discrete and mutually dependent random variables to display conditional probabilities of a single variable with respect to the others (i.e., the probability of each possible value of one variable if we know the values taken on by the other variables). For example, assume there are three random variables x 1 , x 2 , x 3 {\displaystyle x_{1},x_{2},x_{3}} where each has K {\displaystyle K} states. Then, the conditional probability table of x 1 {\displaystyle x_{1}} provides the conditional probability values P ( x 1 = a k x 2 , x 3 ) {\displaystyle P(x_{1}=a_{k}\mid x_{2},x_{3})} – where the vertical bar | {\displaystyle |} means “given the values of” – for each of the K possible values a k {\displaystyle a_{k}} of the variable x 1 {\displaystyle x_{1}} and for each possible combination of values of x 2 , x 3 . {\displaystyle x_{2},\,x_{3}.} This table has K 3 {\displaystyle K^{3}} cells. In general, for M {\displaystyle M} variables x 1 , x 2 , , x M {\displaystyle x_{1},x_{2},\ldots ,x_{M}} with K i {\displaystyle K_{i}} states for each variable x i , {\displaystyle x_{i},} the CPT for any one of them has the number of cells equal to the product K 1 K 2 K M . {\displaystyle K_{1}K_{2}\cdots K_{M}.}

A conditional probability table can be put into matrix form. As an example with only two variables, the values of P ( x 1 = a k x 2 = b j ) = T k j , {\displaystyle P(x_{1}=a_{k}\mid x_{2}=b_{j})=T_{kj},} with k and j ranging over K values, create a K×K matrix. This matrix is a stochastic matrix since the columns sum to 1; i.e. k T k j = 1 {\displaystyle \sum _{k}T_{kj}=1} for all j. For example, suppose that two binary variables x and y have the joint probability distribution given in this table:

x=0 x=1 P(y)
y=0 4/9 1/9 5/9
y=1 2/9 2/9 4/9
P(x) 6/9 3/9 1

Each of the four central cells shows the probability of a particular combination of x and y values. The first column sum is the probability that x =0 and y equals any of the values it can have – that is, the column sum 6/9 is the marginal probability that x=0. If we want to find the probability that y=0 given that x=0, we compute the fraction of the probabilities in the x=0 column that have the value y=0, which is 4/9 ÷ 6/9 = 4/6. Likewise, in the same column we find that the probability that y=1 given that x=0 is 2/9 ÷ 6/9 = 2/6. In the same way, we can also find the conditional probabilities for y equalling 0 or 1 given that x=1. Combining these pieces of information gives us this table of conditional probabilities for y:

x=0 x=1
P(y=0 given x) 4/6 1/3
P(y=1 given x) 2/6 2/3
Sum 1 1

With more than one conditioning variable, the table would still have one row for each potential value of the variable whose conditional probabilities are to be given, and there would be one column for each possible combination of values of the conditioning variables.

Moreover, the number of columns in the table could be substantially expanded to display the probabilities of the variable of interest conditional on specific values of only some, rather than all, of the other variables.

References

  1. Murphy, KP (2012). Machine learning: a probabilistic perspective. The MIT Press.
Category: