Conditional probability table: Difference between revisions

Content deleted Content added
Mhfirooz (talk | contribs)
No edit summary
 
(38 intermediate revisions by 15 users not shown)
Line 1:
{{UnsourcedRefimprove|date=December 2013}}
In [[statistics]], the Conditional Probability Table (CPT) is defined for a set of discrete (not independent) [[random variable]] to demonstrate [[marginal probability]] of a single variable with respect to the others. For example, assume there are three random variables <math>x_1,x_2, x_3</math> where each have <math>K</math> states. Then, the conditional probability table of <math>x_1</math> provides the marginal probability math values for <math>P(x_1|x_2,x_3)</math>. Clearly, this table has <math>O(K^3)</math> number of rows. In general, for <math>M</math> number of variables <math>x_1,x_2,...,x_M</math> with <math>K</math> states, the CPT has the size of <math>O(K^M)</math>.
 
In [[statistics]], the Conditional'''conditional Probabilityprobability Tabletable (CPT)''' is defined for a set of discrete (notand independentmutually [[independence (probability)|dependent]] [[random variable]]s to demonstratedisplay [[marginalconditional probability|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 <math>x_1,x_2, x_3</math> where each havehas <math>K</math> states. Then, the conditional probability table of <math>x_1</math> provides the marginalconditional probability math values for <math>P(x_1|=a_k\mid x_2,x_3)</math>. Clearly– where the vertical bar <math>|</math> means “given the values of” – for each of the ''K'' possible values <math>a_k</math> of the variable <math>x_1</math> and for each possible combination of values of <math>x_2,\, x_3.</math> thisThis table has <math>O(K^3)</math> number of rowscells. In general, for <math>M</math> number of variables <math>x_1,x_2,...\ldots,x_M</math> with <math>KK_i</math> states for each variable <math>x_i,</math> the CPT for any one of them has the sizenumber of cells equal to the product <math>O(K^M)K_1K_2\cdots K_M.</math>.<ref name=murphybook>{{cite book|last=Murphy|first=KP|title=Machine learning: a probabilistic perspective|year=2012|publisher=The MIT Press}}</ref>
CPT table can be put into a matrix form. For example, the values of <math>P(x_j|x_i)=T_{ij}</math> create a matrix. This matrix is [[Stochastic matrix]] since its row sum is equals to 1; i.e. <math>\sum_j T_{ij}</math>.
 
A conditional probability table can be put into [[matrix (mathematics)|matrix]] form. As an example with only two variables, the values of <math>P(x_1=a_k\mid x_2=b_j)=T_{kj},</math> 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. <math>\sum_k T_{kj} = 1</math> for all ''j''. For example, suppose that two [[binary variable]]s ''x'' and ''y'' have the [[joint probability distribution]] given in this table:
{{Uncategorized|date=December 2013}}
 
{|class="wikitable"
|-
! !! 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'':
 
{|class="wikitable"
|-
! !! 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==
{{Reflist}}
 
[[Category:Conditional probability]]