Macaulay2 » Documentation
Packages » GraphicalModels :: bidirectedEdgesMatrix
next | previous | forward | backward | up | index | toc

bidirectedEdgesMatrix -- matrix corresponding to the bidirected edges of a bigraph or a mixed graph

Synopsis

Description

This method returns the $n \times{} n$ covariance matrix of the noise variables in the Gaussian graphical model. The diagonal in this matrix consists of the indeterminates $p_{(i,i)}$. Each off-diagonal entry is zero unless there is a bidirected edge between i and j in which case the corresponding entry in the matrix is the indeterminate $p_{(i,j)}$. The documentation of gaussianRing further describes the indeterminates $p_{(i,j)}$.

i1 : G = mixedGraph(digraph {{b,{c,d}},{c,{d}}},bigraph {{a,d}})

o1 = MixedGraph{Bigraph => Bigraph{a => {d}}   }
                                   d => {a}
                Digraph => Digraph{b => {c, d}}
                                   c => {d}
                                   d => {}
                Graph => Graph{}

o1 : MixedGraph
i2 : R = gaussianRing G

o2 = R

o2 : PolynomialRing
i3 : compactMatrixForm =false;
i4 : bidirectedEdgesMatrix R

o4 = |  p       0     0   p     |
     |   a,a               a,d  |
     |                          |
     |    0   p       0     0   |
     |         b,b              |
     |                          |
     |    0     0   p       0   |
     |               c,c        |
     |                          |
     |  p       0     0   p     |
     |   a,d               d,d  |

             4      4
o4 : Matrix R  <-- R

For mixed graphs that also have undirected edges, the size of the matrix coincides with the number of elements in compW, which depends on the vertex partition built in partitionLMG.

i5 : G = mixedGraph(digraph {{1,3},{2,4}},bigraph {{3,4}},graph {{1,2}});
i6 : R = gaussianRing G

o6 = R

o6 : PolynomialRing
i7 : bidirectedEdgesMatrix R

o7 = |  p     p     |
     |   3,3   3,4  |
     |              |
     |  p     p     |
     |   3,4   4,4  |

             2      2
o7 : Matrix R  <-- R

Bidirected graphs can also be considered:

i8 : G = bigraph {{a,d},{b},{c}}

o8 = Bigraph{a => {d}}
             b => {}
             c => {}
             d => {a}

o8 : Bigraph
i9 : R = gaussianRing G

o9 = R

o9 : PolynomialRing
i10 : bidirectedEdgesMatrix R

o10 = |  p       0     0   p     |
      |   a,a               a,d  |
      |                          |
      |    0   p       0     0   |
      |         b,b              |
      |                          |
      |    0     0   p       0   |
      |               c,c        |
      |                          |
      |  p       0     0   p     |
      |   a,d               d,d  |

              4      4
o10 : Matrix R  <-- R

See also

Ways to use bidirectedEdgesMatrix:

For the programmer

The object bidirectedEdgesMatrix is a method function.