Skip to content
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
601 commits
Select commit Hold shift + click to select a range
ea946ef
fix printing
antonydellavecchia Aug 20, 2025
481c85f
Fix vanishing_ideal with localized rings (#21)
taboege Aug 20, 2025
f2c2471
add Type
antonydellavecchia Aug 20, 2025
30c3704
Merge remote-tracking branch 'origin/alg-stats-1.0' into alg-stats-1.0
antonydellavecchia Aug 20, 2025
f999272
Merge remote-tracking branch 'og/adv/move-phylo' into alg-stats-1.0
antonydellavecchia Aug 20, 2025
a2471ba
affine parametrizations
Aug 20, 2025
1bec479
documentation phylogenetic models - 1
Aug 20, 2025
a75837a
trying things out
antonydellavecchia Aug 20, 2025
3fc79dc
documentation phylogenetic models - 2
Aug 20, 2025
78d6fc8
documentation phylogenetic models - 3
Aug 21, 2025
c7bc9db
Merge remote-tracking branch 'origin/alg-stats-1.0' into alg-stats-1.0
antonydellavecchia Aug 21, 2025
49b09fb
fix typo
antonydellavecchia Aug 21, 2025
4ef3be5
Merge remote-tracking branch 'og/master' into alg-stats-1.0
antonydellavecchia Aug 21, 2025
fa3fc13
will merge data in a later pr
antonydellavecchia Aug 21, 2025
4ed7d8a
will merge these changes with data PR
antonydellavecchia Aug 21, 2025
c96a277
remove old exports from faulty merge
antonydellavecchia Aug 21, 2025
033f535
faulty merge typo
antonydellavecchia Aug 21, 2025
0852897
remove commented code
antonydellavecchia Aug 21, 2025
ad11a03
more faulty merge stuff
antonydellavecchia Aug 21, 2025
ffb3086
Merge remote-tracking branch 'og/master' into alg-stats-1.0
antonydellavecchia Aug 21, 2025
a92123d
Merge branch 'alg-stats-1.0' into adv/phylo-tree-in-model
antonydellavecchia Aug 21, 2025
439d566
moving loading models to new pr
antonydellavecchia Aug 21, 2025
0398b66
remove redundant files
antonydellavecchia Aug 21, 2025
5963526
remove added line
antonydellavecchia Aug 21, 2025
481efa4
move export to different PR
antonydellavecchia Aug 21, 2025
0100a88
Merge branch 'alg-stats-1.0' into adv/phylo-tree-in-model
antonydellavecchia Aug 21, 2025
d13790b
fix typos
antonydellavecchia Aug 21, 2025
59cca0c
update phylogenetic tree struct to contain root
antonydellavecchia Aug 22, 2025
5dbf942
some hacks + root finding in newick function
antonydellavecchia Aug 22, 2025
c8d9618
update phylogenetic tree struct to contain root
antonydellavecchia Aug 22, 2025
6f00337
Update src/Combinatorics/PhylogeneticTrees.jl
antonydellavecchia Aug 22, 2025
287a33a
Merge remote-tracking branch 'og/master' into adv/phylo-tree-in-model
antonydellavecchia Aug 25, 2025
d80c295
bACkt o root at 1
antonydellavecchia Aug 25, 2025
1ab7950
tree from grapoh funciton
antonydellavecchia Aug 25, 2025
d13cfa6
moving to different PR
antonydellavecchia Aug 25, 2025
15642f5
add newick functions
antonydellavecchia Aug 25, 2025
6fc8f19
Merge remote-tracking branch 'og/master' into adv/phylo-tree-struct
antonydellavecchia Aug 25, 2025
0f17476
create phylo tree from graph
antonydellavecchia Aug 26, 2025
79ce55e
Merge branch 'adv/phylo-tree-struct' into adv/phylo-tree-in-model
antonydellavecchia Aug 26, 2025
a6bfdee
updates to phylogenetic_model function for graph input
antonydellavecchia Aug 26, 2025
23944d0
updates to phylogenetic_model function for graph input
antonydellavecchia Aug 26, 2025
3b2b71d
started adding to tests
antonydellavecchia Aug 26, 2025
4c30046
removed is_tree (move to other pr)
antonydellavecchia Aug 26, 2025
7a22ec3
progress
antonydellavecchia Aug 26, 2025
530c2ac
finishing details
antonydellavecchia Aug 26, 2025
41830f1
all more label types
antonydellavecchia Aug 27, 2025
53d9fe2
moving pmdata functions to (now less) useless file
antonydellavecchia Aug 27, 2025
ba4f5d3
fix labelings with QQField ELem
antonydellavecchia Aug 27, 2025
8649e7b
new struct for phylo networks
Aug 27, 2025
74c875e
Merge remote-tracking branch 'og/master' into adv/phylo-tree-struct
antonydellavecchia Aug 27, 2025
38b9fe2
polymake version bump
antonydellavecchia Aug 27, 2025
7bb1fed
bound graph map value types
antonydellavecchia Aug 27, 2025
a510610
parameter_ring for PhyloNetwork
Aug 27, 2025
7084ea8
fix type bounds
antonydellavecchia Aug 27, 2025
da3ccd3
full_parametrization for PhyloNetwork
Aug 27, 2025
adbe8dd
adding some TODOs
Aug 27, 2025
02501d9
missed float64
antonydellavecchia Aug 28, 2025
fe35c1f
fix unbounded type
antonydellavecchia Aug 28, 2025
6544cfb
test for persistent labels
antonydellavecchia Aug 28, 2025
e50e0a0
import _pmdata_for_oscar into Serialization module
antonydellavecchia Aug 28, 2025
6c48fdc
update map creation to use polymake updates
antonydellavecchia Aug 28, 2025
df4bcbe
add _root function
antonydellavecchia Aug 28, 2025
026ebd3
revert change in experimental
antonydellavecchia Aug 28, 2025
1d921b0
fix newick output in doctest
antonydellavecchia Aug 29, 2025
1b71e6e
Merge remote-tracking branch 'og/master' into adv/phylo-tree-struct
antonydellavecchia Aug 29, 2025
e4f3d9b
Merge remote-tracking branch 'og/master' into adv/phylo-tree-struct
antonydellavecchia Aug 29, 2025
01d7478
fix printing
antonydellavecchia Aug 29, 2025
3d15e84
Merge remote-tracking branch 'origin/adv/phylo-tree-in-model' into ad…
antonydellavecchia Aug 31, 2025
f0f8afb
Merge branch 'adv/phylo-tree-struct' into adv/phylo-tree-in-model
antonydellavecchia Aug 31, 2025
139ed15
fix adjacency_tree
antonydellavecchia Aug 31, 2025
6eaa1c0
add test example
antonydellavecchia Aug 31, 2025
e7490b8
fix printing
antonydellavecchia Aug 29, 2025
6455260
fix adjacency_tree
antonydellavecchia Aug 31, 2025
2f5cef9
fix tests
antonydellavecchia Aug 31, 2025
6d2fc43
remove empty line
antonydellavecchia Sep 2, 2025
59833bd
Merge branch 'adv/phylo-tree-in-model' into mgl/sunlets
antonydellavecchia Sep 2, 2025
c84817b
add todo
antonydellavecchia Sep 2, 2025
f68fc0e
Fix hashing of CIStmt
taboege Aug 14, 2025
ca18a48
Markov properties for undirected graphs
taboege Aug 14, 2025
7009a52
Markov properties for directed acyclic graphs
taboege Aug 14, 2025
99379d9
Add ci_structure methods for graphical models based on global_markov
taboege Aug 15, 2025
a9d56e0
Apply code review
taboege Sep 2, 2025
6fd4906
Merge pull request #19 from bkholler/markov-properties
taboege Sep 2, 2025
ea30e54
Fix `model_ring` and `parametrization` for discrete undirected models
taboege Sep 3, 2025
6d4824b
Birational implicitization for Gaussian graphical models
taboege Sep 3, 2025
0971d24
Use algorithm=:markov for discrete undirected vanishing ideals
taboege Sep 3, 2025
d5ad2c1
Fix state_space for singleton arguments
taboege Sep 4, 2025
b743c86
Make discrete directed graphical models work again
taboege Sep 4, 2025
e6994c4
Apply code review suggestions
taboege Sep 4, 2025
288df2b
Merge pull request #24 from bkholler/discrete-directed
taboege Sep 4, 2025
4f935d7
Fall back to elimination for cyclic Gaussian directed models
taboege Sep 4, 2025
e622794
Merge pull request #23 from bkholler/better-vanishing-ideals
taboege Sep 4, 2025
c347835
assigned dev serialization version accroding to n upgrades
antonydellavecchia Sep 18, 2025
42b55c0
Update src/Serialization/main.jl
antonydellavecchia Sep 18, 2025
d021949
started upgrade script
antonydellavecchia Sep 18, 2025
4b1988c
skeleton for stream lined upgrades
antonydellavecchia Sep 18, 2025
1160cad
add docs and comments about upgrade order
antonydellavecchia Sep 19, 2025
1b0d239
progress on upgrading containers function
antonydellavecchia Sep 22, 2025
bb8f6f7
upgrade_containers missing Dict handling
antonydellavecchia Sep 22, 2025
0b60c67
small changes
antonydellavecchia Sep 22, 2025
ad0152b
Merge remote-tracking branch 'og/adv/multiple-serialization-upgrades'…
antonydellavecchia Sep 22, 2025
8721098
dicts
antonydellavecchia Sep 22, 2025
e5a1446
adds upgrade
antonydellavecchia Sep 23, 2025
7ecce72
NamedTuple + Tuple fix
antonydellavecchia Sep 23, 2025
802867b
fix typo for Tuples
antonydellavecchia Sep 23, 2025
0b8e62c
fix for multidimarray
antonydellavecchia Sep 23, 2025
929588b
Merge branch 'adv/phylo-tree-struct' into adv/phylo-tree-in-model
antonydellavecchia Sep 23, 2025
990ff74
Merge branch 'alg-stats-1.0' into adv/phylo-tree-in-model
antonydellavecchia Sep 23, 2025
fcd056b
Revert "will merge data in a later pr"
antonydellavecchia Sep 23, 2025
7536883
fix bug
Sep 24, 2025
ea89c31
change order types PhyloModel
Sep 24, 2025
72c77dd
added network to GroupBasedPM
Sep 24, 2025
aa7c16c
saving and load phylo models working
antonydellavecchia Sep 24, 2025
440cfbc
parameter_ring and full_parametrization for gb models in networkd
Sep 24, 2025
b441785
type fixed
Sep 25, 2025
76d25ef
fixed parametrization for PM/BGPM and Tree/Network
Sep 25, 2025
c1d7066
message for networks updated
Sep 26, 2025
ec8c1ca
documentation updated
Sep 29, 2025
3512802
add acyclic checks
antonydellavecchia Oct 2, 2025
dc0dba4
update hash to master branch (serialization-upgrade-tests)
antonydellavecchia Oct 2, 2025
c0715d9
Revert "update hash to master branch (serialization-upgrade-tests)"
antonydellavecchia Oct 2, 2025
6ce208b
Merge remote-tracking branch 'og/master' into alg-stats-1.0
antonydellavecchia Oct 8, 2025
0472d44
Merge remote-tracking branch 'origin/alg-stats-1.0' into alg-stats-1.0
antonydellavecchia Oct 8, 2025
37b3f9a
Merge branch 'alg-stats-1.0' into adv/phylo-tree-data
antonydellavecchia Oct 8, 2025
51db1fc
remove redundant file
antonydellavecchia Oct 8, 2025
a71e182
remove redundant data files
antonydellavecchia Oct 8, 2025
d04f5ee
readd removed code from faulty merge
antonydellavecchia Oct 8, 2025
e3fe6fe
fix spacing
antonydellavecchia Oct 8, 2025
87425d9
readd multigraded docs
antonydellavecchia Oct 8, 2025
4724cc2
isomorphic fix + remove redundant edge iterator
antonydellavecchia Oct 8, 2025
45402a6
Merge remote-tracking branch 'og/master' into alg-stats-1.0
antonydellavecchia Oct 10, 2025
a974216
fixing faulty merge + docs
antonydellavecchia Oct 10, 2025
1c2402e
Merge remote-tracking branch 'og/master' into alg-stats-1.0
antonydellavecchia Oct 14, 2025
acfe59b
Apply suggestions from code review
antonydellavecchia Oct 14, 2025
029ce09
redundant file remove
antonydellavecchia Oct 14, 2025
9104b4c
add line
antonydellavecchia Oct 14, 2025
c7d23eb
Merge remote-tracking branch 'origin/alg-stats-1.0' into alg-stats-1.0
antonydellavecchia Oct 14, 2025
d7b2dfb
some fixes for docs
antonydellavecchia Oct 14, 2025
33a0073
doc string fixes
antonydellavecchia Oct 15, 2025
642fa4d
typo
antonydellavecchia Oct 15, 2025
ab1d11c
fix regression + tidy K3P test
antonydellavecchia Oct 15, 2025
e967d77
documentation
Oct 15, 2025
db0b5c3
documentation for phyloNetworks
Oct 15, 2025
ff549c3
foctest fix
antonydellavecchia Oct 15, 2025
03f695d
fixing documentation
Oct 16, 2025
a859761
fixing documentation 2
Oct 16, 2025
e57c1bf
Merge branch 'mgl/sunlets' into alg-stats-1.0
antonydellavecchia Oct 16, 2025
f773e78
removing old files
antonydellavecchia Oct 16, 2025
18a621c
Merge remote-tracking branch 'origin/alg-stats-1.0' into alg-stats-1.0
antonydellavecchia Oct 16, 2025
3faddff
small things
antonydellavecchia Oct 16, 2025
5deb4d7
Merge branch 'mgl/sunlets' into alg-stats-1.0
antonydellavecchia Oct 16, 2025
2bd4a2c
remove duplicate show
antonydellavecchia Oct 16, 2025
04b8956
fixing doctests
Oct 17, 2025
52fd320
fix docs
antonydellavecchia Oct 17, 2025
6ebd48f
Apply suggestions from code review
antonydellavecchia Oct 17, 2025
ad974d7
some suggestions from code review
antonydellavecchia Oct 17, 2025
6dcf092
Merge remote-tracking branch 'origin/alg-stats-1.0' into alg-stats-1.0
antonydellavecchia Oct 17, 2025
dd525b2
Organizing code
Oct 17, 2025
4031439
Merge branch 'alg-stats-1.0' of github.com:bkholler/Oscar.jl into alg…
Oct 17, 2025
910e701
Improv docs model ring
Oct 17, 2025
92b8db6
fixing doctests
Oct 17, 2025
4981405
fixing more doctests
Oct 17, 2025
ec3f4c0
tests for PhylogeneticNetworks
Oct 19, 2025
8dd9fb3
fixing tests and problems with the new model_ring
Oct 19, 2025
377344a
fixing problems with new model_ring
Oct 20, 2025
5752d54
fixing docs new model_ring
Oct 20, 2025
3a2465a
standard PM over field F not necessarily QQ
Oct 20, 2025
a369edb
change return vanishing_ideal for algorithm == :f4
Oct 20, 2025
17ee4eb
vanishing_ideal in phylogenetics docs
Oct 20, 2025
a14f286
todo: docs vanishing_ideal
Oct 20, 2025
f337329
Added sorted_edges in parameter_ring
Oct 20, 2025
91a5450
fix for tests
antonydellavecchia Oct 20, 2025
3309450
Added test for parametrization level-1 networks
Oct 20, 2025
e8a5769
Merge branch 'alg-stats-1.0' of github.com:bkholler/Oscar.jl into alg…
Oct 20, 2025
ee58b63
docs for field in JC, K2P,... & sorted_edges
Oct 21, 2025
ec93a2c
still issues with Iterators.product
antonydellavecchia Oct 21, 2025
95fa61a
Merge remote-tracking branch 'origin/alg-stats-1.0' into alg-stats-1.0
antonydellavecchia Oct 21, 2025
8e255d1
remove sort
antonydellavecchia Oct 21, 2025
2bbacc1
imporvements to type stability
antonydellavecchia Oct 21, 2025
a54d120
spacing
antonydellavecchia Oct 21, 2025
55d7dd0
trying to fix parameter_ring docs
antonydellavecchia Oct 21, 2025
1be0e40
update to the abtstract graphical model docs
antonydellavecchia Oct 21, 2025
c8ad097
fix typo
antonydellavecchia Oct 21, 2025
dab49bb
fix discrete model docs
antonydellavecchia Oct 22, 2025
4268238
fix duplicate parameter_ring
antonydellavecchia Oct 22, 2025
d6596aa
fix docs
antonydellavecchia Oct 22, 2025
11800b3
removed export and duplicate code
antonydellavecchia Oct 22, 2025
63eab9c
remove undefined export
antonydellavecchia Oct 22, 2025
b081ba9
last 2
antonydellavecchia Oct 22, 2025
fbb4986
Merge remote-tracking branch 'og/master' into alg-stats-1.0
antonydellavecchia Oct 22, 2025
3299daa
type tidy + add tests for Discrete models
antonydellavecchia Oct 27, 2025
36b21ca
add antony's link
antonydellavecchia Oct 27, 2025
dc839a6
Renaming + serialization fixing
antonydellavecchia Oct 27, 2025
99b18e8
minor serialization adjustments
antonydellavecchia Oct 27, 2025
13468e5
fix serialization
antonydellavecchia Oct 27, 2025
466a1a4
fixes for alg stats serialization
antonydellavecchia Oct 27, 2025
a7c3f7e
fixes for tests
antonydellavecchia Oct 27, 2025
b6a074b
serialization tests
antonydellavecchia Oct 29, 2025
04defd7
fixes doc test failure
antonydellavecchia Oct 29, 2025
8ca4796
fixes for test
antonydellavecchia Oct 29, 2025
716fa59
Merge remote-tracking branch 'og/master' into alg-stats-1.0
antonydellavecchia Oct 29, 2025
9cbc16b
Merge remote-tracking branch 'og/master' into alg-stats-1.0
antonydellavecchia Oct 29, 2025
08d5d93
typo
antonydellavecchia Oct 29, 2025
9fdf339
ensure GraphDict is return type
antonydellavecchia Oct 29, 2025
dfcc492
fix parameter ring docs in phylogenetics
antonydellavecchia Oct 30, 2025
476ad74
adds docs for indexed_ring
antonydellavecchia Oct 30, 2025
eb2cd9f
skip serilization test for phylogenetic models for now until bug fix
antonydellavecchia Oct 30, 2025
016f922
use descendants instead of vertex descendants
antonydellavecchia Nov 5, 2025
8cf14d1
tidy descendants
antonydellavecchia Nov 5, 2025
8cf8a14
fix typos
antonydellavecchia Nov 5, 2025
d7df06b
update readme
antonydellavecchia Nov 5, 2025
706845b
fix docs + printing
antonydellavecchia Nov 5, 2025
cb85e7a
fix typo
antonydellavecchia Nov 5, 2025
c8e2a51
fix printing in doctests
antonydellavecchia Nov 5, 2025
cad0f20
fix other doctets not in src
antonydellavecchia Nov 5, 2025
09e5be9
fix typo
antonydellavecchia Nov 5, 2025
cdfa186
Apply suggestions from code review
antonydellavecchia Nov 6, 2025
f55b255
Apply suggestions from code review
antonydellavecchia Nov 6, 2025
01f44d4
update phylo docs
antonydellavecchia Nov 6, 2025
d2bd0b0
Merge remote-tracking branch 'origin/alg-stats-1.0' into alg-stats-1.0
antonydellavecchia Nov 6, 2025
fd71a4b
fix docs
antonydellavecchia Nov 6, 2025
7aadcb1
keep polymake graph in EdgeIterator wrapper
benlorenz Nov 7, 2025
8ec8d30
remove code duplication + add build context
antonydellavecchia Nov 10, 2025
757d2a8
cleanup tests, + small improvements
antonydellavecchia Nov 10, 2025
e277adf
some cleanup for indexed ring
antonydellavecchia Nov 12, 2025
d19ae8c
fix index ring docs
antonydellavecchia Nov 12, 2025
90d5cf2
fix doctest
antonydellavecchia Nov 12, 2025
06d37e7
map exponent vectors etc indtead of polys
antonydellavecchia Nov 13, 2025
7d0b809
degrees from simplex
antonydellavecchia Nov 13, 2025
2f99547
Revert "map exponent vectors etc indtead of polys"
antonydellavecchia Nov 13, 2025
4699add
optimized degree over simplex
antonydellavecchia Nov 13, 2025
84ed4e8
Reapply "map exponent vectors etc indtead of polys"
antonydellavecchia Nov 13, 2025
e1b92f4
fix indent
antonydellavecchia Nov 13, 2025
1f24e61
monomial_map function
antonydellavecchia Nov 13, 2025
b304da5
loosen scope of monomial_map
antonydellavecchia Nov 13, 2025
f241506
fix spacing
antonydellavecchia Nov 13, 2025
db64c96
skip duplicates
antonydellavecchia Nov 13, 2025
7959da4
speed up for equivalent classes
antonydellavecchia Nov 13, 2025
7769231
fix simplex degrees
antonydellavecchia Nov 14, 2025
641f1ab
fix sign changes
antonydellavecchia Nov 14, 2025
aa5b25c
fix issues with graph maps in polymake objects
benlorenz Nov 14, 2025
14dc6d5
tests: simplify running tests for main process
benlorenz Nov 14, 2025
0e28185
fix docs
antonydellavecchia Nov 14, 2025
b4efce3
Merge remote-tracking branch 'origin/alg-stats-1.0' into alg-stats-1.0
antonydellavecchia Nov 14, 2025
6c0502c
fix ordering of components of kernel output
antonydellavecchia Nov 14, 2025
934aa42
fix ordering in test
antonydellavecchia Nov 14, 2025
a5117d3
speed degree over simplex
antonydellavecchia Nov 14, 2025
0723edd
fix for parametrization when root distribution is not QQFieldElem
antonydellavecchia Nov 14, 2025
362db82
general markov tests
antonydellavecchia Nov 14, 2025
466550e
remove testing artifact
antonydellavecchia Nov 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions experimental/AlgebraicStatistics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ new functionality.

## Status

- [ ] Conditional independence models
- [ ] Gaussian ideals
- [X] Conditional independence models
- [X] Gaussian ideals
- [X] Discrete ideals
- [ ] Directed graphical models (Bayesian networks)
- [ ] Markov properties
- [ ] Trek separation
- [X] Directed graphical models (Bayesian networks)
- [X] Markov properties
- [X] Trek separation
- [X] Gaussian parametrization
- [ ] Discrete parametrization
- [X] Discrete parametrization
- [X] Undirected graphical models (Markov networks)
- [ ] Markov properties
- [X] Markov properties
- [X] Gaussian parametrization
- [ ] Discrete parametrization
- [ ] Phylogenetics
- [X] Discrete parametrization
- [X] Phylogenetics
- [X] Cavender--Farris--Neyman model
- [X] Jukes--Cantor model
- [X] Kimura2 / Kimura3
Expand Down
14 changes: 7 additions & 7 deletions experimental/AlgebraicStatistics/docs/doc.main
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[
"Algebraic Statistics" => [
"introduction.md",
"graphical_models.md",
"gaussian_graphical_models.md",
"ci.md",
"markov.md",
"phylogenetics.md",
"multigraded_implicitization.md",
"introduction.md",
"graphical_models.md",
"gaussian_graphical_models.md",
"markov.md",
"phylogenetics.md",
"ci.md",
"multigraded_implicitization.md"
]
]
7 changes: 4 additions & 3 deletions experimental/AlgebraicStatistics/docs/src/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ to define ideals. Their interpretations as polynomial equations depend
on the ambient ring ([`markov_ring`](@ref) or [`gaussian_ring`](@ref)).

```@docs
ci_stmt(I::Vector{<:VarName}, J::Vector{<:VarName}, K::Vector{<:VarName})
@CI_str(str)
ci_stmt
@CI_str
Base.:(==)(lhs::CIStmt, rhs::CIStmt)
Base.hash(stmt::CIStmt, h::UInt)
ci_statements(random_variables::Vector{<:VarName})
ci_statements
ci_ideal
make_elementary(stmt::CIStmt; semigaussoid=false)
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,33 @@ DocTestSetup = Oscar.doctestsetup()

# Gaussian Graphical Models

The OSCAR type for graphical models is of parametrized form `GraphicalModel{G, T}` where `T` represents the type of ring in which the vanishing ideal of the model belongs and `G` represents the associated graph. Gaussian graphical models are those where the `T` is of type `GaussianRing` which is a multivariate polynomial ring equipped with some extra features.

## Gaussian Rings
Gaussian graphical model types are parametrized as `GaussianGraphicalModel{T, L}` where `T` represents the type of graph and `L` represents the labelings of the graph. The parameters `T` and `L` are determined by the graph used to construct the model.

```@docs
gaussian_ring(n::Int; s_var_name::VarName="s", K::Field=QQ, cached=false)
gens(R::GaussianRing)
covariance_matrix(R::GaussianRing)
```

## Directed Gaussian Graphical Models

A directed Gaussian graphical model is constructed from `G::Graph{Directed}` and `S::GaussianRing`. Optionally, the user may specify a string `l_var_name::String` which corresponds to the edge weights in the parametrization of the model and a string `w_var_name::String` for labeling the error covariance parameters.
```@docs
graphical_model(G::Graph{Directed}, S::GaussianRing; l_var_name::VarName="l", w_var_name::VarName="w", cached=false)
gaussian_graphical_model
```

## Directed Gaussian Graphical Model
The parametrization for a directed Gaussian graphical model on a DAG $G$ is built from the weighted adjacency matrix $\Lambda$ and the covariance matrix $\Omega$ of the error terms. The model is then the set of all covariance matrices $\Sigma = (Id - \Lambda)^{-T} \Omega (Id - \Lambda)^{-1}$. $\Lambda$ and $\Omega$ can be built with the following functions:
```@docs
directed_edges_matrix(M::GraphicalModel{Graph{Directed}, GaussianRing})
error_covariance_matrix(M::GraphicalModel{Graph{Directed}, GaussianRing})
directed_edges_matrix
error_covariance_matrix
```

It is easy to create new types of graphical models by overloading the methods `directed_edges_matrix` and `error_covariance_matrix`. For instance, colored graphical models may easily be created by creating a new type of `GraphicalModel{G, T}` and a new `directed_edges_matrix` function. The following two functions will then work almost immediately on this new type.
```@docs
parametrization(M::GraphicalModel{Graph{Directed}, GaussianRing})
vanishing_ideal(M::GraphicalModel{Graph{Directed}, GaussianRing})
```

With almost all graphical models, the vanishing ideal is computed by taking the kernel of the ring map given by `parametrization(M:GraphicalModel{G, T})`.



## Undirected Gaussian Graphical Models
## Undirected Gaussian Graphical Model
As with their directed counterpart, it is very easy to create new subtypes of graphical models by overloading the function `concentration_matrix` below. Unlike most other types of graphical models though, the vanishing ideal computation of an undirected graphical model is done by eliminating all concentration variables $k_{ij}$ from the ideal given by the equations $\Sigma K - Id$ after saturating by $\det(K)$.


A undirected Gaussian graphical model is constructed from `G::Graph{Undirected}`, `S::GaussianRing`. Optionally, the user may specify a string `k_var_name::String` which corresponds to the entries of the concentration matrix.
```@docs
graphical_model(G::Graph{Undirected}, S::GaussianRing; k_var_name::VarName="k", cached=false)
concentration_matrix
```

As with their directed counterpart, it is very easy to create new subtypes of graphical models by overloading the function `concentration_matrix` below. Unlike most other types of graphical models though, the vanishing ideal computation of an undirected graphical model is done by eliminating all concentration variables $k_{ij}$ from the ideal given by the equations $\Sigma K - Id$ after saturating by $\det(K)$.

## Gaussian Rings

```@docs
concentration_matrix(M::GraphicalModel{Graph{Undirected}, GaussianRing})
parametrization(M::GraphicalModel{Graph{Undirected}, GaussianRing})
vanishing_ideal(M::GraphicalModel{Graph{Undirected}, GaussianRing})
gaussian_ring
covariance_matrix
```
34 changes: 25 additions & 9 deletions experimental/AlgebraicStatistics/docs/src/graphical_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,35 @@ CollapsedDocStrings = true
DocTestSetup = Oscar.doctestsetup()
```

# Graphical Models
# Abstract Graphical Model

The OSCAR type for graphical models is of parametrized form `GraphicalModel{G, T}` where `T` represents the type of ring in which the vanishing ideal of the model belongs and `G` represents the associated graph. This parametrized typing allows the user to easily build upon the existing functionality to work with newer variations on graphical models such as those with colours or hidden variables.
Graphical models are a parametrized abstract type `GraphicalModel{T, L}` where `T` is the type of the graph and `L` is the type of labelings of the graph, this is either a `NamedTuple` type or `Nothing`. Being an abstract type there is no constructor for a graphical model. All graphical models are subtypes of `GraphicalModel`, and they inherit their type parameters from the graph that is passed to the constructor. See the section corresponding to the graphical model type you would like to work with.

Many basic functions are defined for all graphical models `M` such as
## Attributes

- `graph(M)` refers to the associated graph
- `ring(M)` to the multivariate polynomial ring where the model resides
- `param_ring` to the multivariate polynomial ring where the parameters reside
- `param_gens` to the parameters of the model which are ring variables stored typically stored in a hash table for convenient indexing
The following functions are attributes for all graphical models.
```@docs
model_ring(M::T) where T <: GraphicalModel
parameter_ring(M::T) where T <: GraphicalModel
parametrization(M::T) where T <: GraphicalModel
```

## Vanishing ideal

This part of OSCAR also includes some basic graph functionality such as finding the vertices of a graph or its set of maximal cliques. Lastly, while many methods for graphical models depend heavily on whether or not they are discrete/Gaussian or directed/undirected some functionality is independent of this and thus implemented simultaneously for all graphical models. For example, the vanishing ideal of the model:
Ensuring that any concrete graphical model (one that is a subtype of `GraphicalModel`) have implementations for the above attributes ensures
that we can compute the vanishing ideal.
In can be the case that certain graphical models will benefit from certain algorithms, and in those cases the `vanishing_ideal` will be overloaded for that specific type.
In all other cases the vanishing ideal computation will fallback to this general function.
There is a keyword argument for setting algorithm which is set to `:eliminate` by default, other possibilities are `:f4` and `:markov`.

If you are only interested in generators up to a certain degree, considering using [`components_of_kernel`](@ref) with `parametrization`.
```@docs
vanishing_ideal(M::GraphicalModel)
vanishing_ideal(M::GraphicalModel; algorithm::Symbol = :eliminate)
```
# Extending functionality

One major design decision was to allow for the graphs and their labels to parametrize the graphical models.
This allows users to create their own graphical model types and gives them the possibility to overload the appropriate attribute functions.
In this way, users can reuse the implementations for the functions defined for the abstract grpahical models,
which avoids code duplication and also allows for the application of theorems for specific types of graphical models.

1 change: 1 addition & 0 deletions experimental/AlgebraicStatistics/docs/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ Please direct questions about this part of OSCAR to the following people:
- [Benjamin Hollering](https://sites.google.com/view/benhollering)
- [Marina Garrote López](https://sites.google.com/view/marinagarrotelopez)
- [Tobias Boege](https://taboege.de/)
- [Antony Della Vecchia](https://antonydellavecchia.github.io)
10 changes: 3 additions & 7 deletions experimental/AlgebraicStatistics/docs/src/markov.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ with the ambient polynomial ring in these ``p`` variables, special forms
in them like marginals, and conditional independence ideals.

```@docs
markov_ring(rvs::Pair{<:VarName, <:AbstractArray}...; unknown::VarName="p", K::Field=QQ, cached=false)
tensor_ring(rvs::Pair{<:VarName, <:AbstractArray}...; unknown::VarName="p", K::Field=QQ, cached=false)
markov_ring
ring(R::MarkovRing)
random_variables(R::MarkovRing)
ci_statements(R::MarkovRing)
unknowns(R::MarkovRing)
gens(R::MarkovRing)
find_random_variables(R::MarkovRing, K)
find_state(R::MarkovRing, K, x)
state_space(R::MarkovRing, K=random_variables(R))
parameter_ring(M::DiscreteGraphicalModel{Graph{Undirected}, T}; cached=false) where T
marginal(R::MarkovRing, K, x)
ci_ideal(R::MarkovRing, stmts)
indexed_ring(R::Ring, varnames; kw...)
```
Loading