next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
GraphicalModels :: gaussianRing

gaussianRing -- ring of gaussian correlations on n random variables

Synopsis

Description

The routines gaussianIdeal and trekIdeal require that the ring be created by this function.
i1 : R = gaussianRing 5;
i2 : gens R

o2 = {s   , s   , s   , s   , s   , s   , s   , s   , s   , s   , s   , s   ,
       1,1   1,2   1,3   1,4   1,5   2,2   2,3   2,4   2,5   3,3   3,4   3,5 
     ------------------------------------------------------------------------
     s   , s   , s   }
      4,4   4,5   5,5

o2 : List
i3 : covarianceMatrix R

o3 = | s_(1,1) s_(1,2) s_(1,3) s_(1,4) s_(1,5) |
     | s_(1,2) s_(2,2) s_(2,3) s_(2,4) s_(2,5) |
     | s_(1,3) s_(2,3) s_(3,3) s_(3,4) s_(3,5) |
     | s_(1,4) s_(2,4) s_(3,4) s_(4,4) s_(4,5) |
     | s_(1,5) s_(2,5) s_(3,5) s_(4,5) s_(5,5) |

             5       5
o3 : Matrix R  <--- R
For mixed graphs, there is a variable l(i,j) for each directed edge i->j, a variable w(i,i) for each node i, and a variable w(i,j) for each bidirected edge i<->j.
i4 : G = mixedGraph(digraph {{b,{c,d}},{c,{d}}},bigraph {{a,d}})

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

o4 : MixedGraph
i5 : R = gaussianRing G

o5 = R

o5 : PolynomialRing
i6 : gens R

o6 = {l   , l   , l   , p   , p   , p   , p   , p   , s   , s   , s   , s   ,
       b,c   b,d   c,d   a,a   b,b   c,c   d,d   a,d   a,a   a,b   a,c   a,d 
     ------------------------------------------------------------------------
     s   , s   , s   , s   , s   , s   }
      b,b   b,c   b,d   c,c   c,d   d,d

o6 : List
i7 : covarianceMatrix(R,G)

o7 = | s_(a,a) s_(a,b) s_(a,c) s_(a,d) |
     | s_(a,b) s_(b,b) s_(b,c) s_(b,d) |
     | s_(a,c) s_(b,c) s_(c,c) s_(c,d) |
     | s_(a,d) s_(b,d) s_(c,d) s_(d,d) |

             4       4
o7 : Matrix R  <--- R
i8 : directedEdgesMatrix(R,G)

o8 = | 0 0 0       0       |
     | 0 0 l_(b,c) l_(b,d) |
     | 0 0 0       l_(c,d) |
     | 0 0 0       0       |

             4       4
o8 : Matrix R  <--- R
i9 : bidirectedEdgesMatrix(R,G)

o9 = | p_(a,a) 0       0       p_(a,d) |
     | 0       p_(b,b) 0       0       |
     | 0       0       p_(c,c) 0       |
     | p_(a,d) 0       0       p_(d,d) |

             4       4
o9 : Matrix R  <--- R

See also

Ways to use gaussianRing :