next | previous | forward | backward | up | top | index | toc | Macaulay2 website
GraphicalModels :: markovMatrices

markovMatrices -- matrices whose minors form the ideal of a list of independence statements

Synopsis

Description

List of matrices whose 2x2 minors form the conditional independence ideal of the independence statements on the list $S$. This method is used in conditionalIndependenceIdeal, it is exported to be able to read independence constraints as minors of matrices instead of their polynomial expansions.

i1 : S = {{{1},{3},{4}}}

o1 = {{{1}, {3}, {4}}}

o1 : List
i2 : R = markovRing (4:2)

o2 = R

o2 : PolynomialRing
i3 : compactMatrixForm =false;
i4 : netList markovMatrices (R,S)

     +----------------------------------------------+
o4 = ||  p        + p         p        + p         ||
     ||   1,1,1,1    1,2,1,1   1,1,2,1    1,2,2,1  ||
     ||                                            ||
     ||  p        + p         p        + p         ||
     ||   2,1,1,1    2,2,1,1   2,1,2,1    2,2,2,1  ||
     +----------------------------------------------+
     ||  p        + p         p        + p         ||
     ||   1,1,1,2    1,2,1,2   1,1,2,2    1,2,2,2  ||
     ||                                            ||
     ||  p        + p         p        + p         ||
     ||   2,1,1,2    2,2,1,2   2,1,2,2    2,2,2,2  ||
     +----------------------------------------------+

Here is an example where the independence statements are extracted from a graph.

i5 : G = graph{{a,b},{b,c},{c,d},{a,d}}

o5 = Graph{a => {b, d}}
           b => {a, c}
           c => {b, d}
           d => {a, c}

o5 : Graph
i6 : S = localMarkov G

o6 = {{{a}, {c}, {d, b}}, {{b}, {d}, {c, a}}}

o6 : List
i7 : R = markovRing (4:2)

o7 = R

o7 : PolynomialRing
i8 : markovMatrices (R,S,vertices G)

o8 = {|  p         p         |, |  p         p         |, |  p       
      |   1,1,1,1   1,1,2,1  |  |   1,1,1,2   1,1,2,2  |  |   1,2,1,1
      |                      |  |                      |  |          
      |  p         p         |  |  p         p         |  |  p       
      |   2,1,1,1   2,1,2,1  |  |   2,1,1,2   2,1,2,2  |  |   2,2,1,1
     ------------------------------------------------------------------------
     p         |, |  p         p         |, |  p         p         |, |
      1,2,2,1  |  |   1,2,1,2   1,2,2,2  |  |   1,1,1,1   1,1,1,2  |  |
               |  |                      |  |                      |  |
     p         |  |  p         p         |  |  p         p         |  |
      2,2,2,1  |  |   2,2,1,2   2,2,2,2  |  |   1,2,1,1   1,2,1,2  |  |
     ------------------------------------------------------------------------
     p         p         |, |  p         p         |, |  p         p       
      1,1,2,1   1,1,2,2  |  |   2,1,1,1   2,1,1,2  |  |   2,1,2,1   2,1,2,2
                         |  |                      |  |                    
     p         p         |  |  p         p         |  |  p         p       
      1,2,2,1   1,2,2,2  |  |   2,2,1,1   2,2,1,2  |  |   2,2,2,1   2,2,2,2
     ------------------------------------------------------------------------
     |}
     |
     |
     |
     |

o8 : List

Caveat

In case the random variables are not numbered $1, 2, \dots, n$, then this method requires an additional input in the form of a list of the random variable names. This list must be in the same order as the implicit order used in the sequence $d$. The user is encouraged to read the caveat on the method conditionalIndependenceIdeal regarding probability distributions on discrete random variables that have been labeled arbitrarily.

See also

Ways to use markovMatrices :

For the programmer

The object markovMatrices is a method function.