gaussianVanishingIdeal computes the ideal in R of homogeneous polynomial relations on the variance-covariance parameters of a graphical model on G as explained in “Lectures on Algebraic Statistics” by Drton, Sturmfels, and Sullivant.
i1 : G = graph({{a,b},{b,c},{c,d},{a,d}}) o1 = Graph{a => set {b, d}} b => set {a, c} c => set {b, d} d => set {a, c} o1 : Graph |
i2 : R = gaussianRing G o2 = R o2 : PolynomialRing |
i3 : J = gaussianVanishingIdeal(R); o3 : Ideal of R |
i4 : ideal mingens J / print; 2 s s s - s s - s s s + s s s + s s s - s s s a,d b,c b,d a,c b,d a,d b,b c,d a,b b,d c,d a,c b,b d,d a,b b,c d,d 2 s s s - s s - s s s + s s s + s s s - s s s a,c a,d b,c a,c b,d a,b a,d c,c a,a b,d c,c a,b a,c c,d a,a b,c c,d |
This method works for graphs, digraphs and mixedgraphs
i5 : G = digraph {{a,{b,c}}, {b,{c,d}}, {c,{}}, {d,{}}} o5 = Digraph{a => set {b, c}} b => set {c, d} c => set {} d => set {} o5 : Digraph |
i6 : R = gaussianRing G o6 = R o6 : PolynomialRing |
i7 : gaussianVanishingIdeal(R) o7 = ideal (- s s + s s , s s - s s , s s - s s ) a,d b,b a,b b,d b,c b,d b,b c,d a,d b,c a,b c,d o7 : Ideal of R |
i8 : H = mixedGraph(digraph {{a,{c}},{b,{c}}, {c,{d}}},bigraph {{c,d}}) o8 = MixedGraph{Bigraph => Bigraph{c => set {d}}} d => set {c} Digraph => Digraph{a => set {c}} b => set {c} c => set {d} d => set {} Graph => Graph{} o8 : MixedGraph |
i9 : S = gaussianRing H o9 = S o9 : PolynomialRing |
i10 : gaussianVanishingIdeal(S) o10 = ideal (s , s s - s s ) a,b a,d b,c a,c b,d o10 : Ideal of S |