stanc3
stanc3 copied to clipboard
Tool to generate model diagram
It would be nice to be able to generate a plate or graph diagram of a Stan model, assuming the model specified is equivalent to a DAG.
Some discussion here: https://discourse.mc-stan.org/t/tool-to-auto-generate-model-diagrams/7361/
And in case, we aren't a generative model, we can always visualize a factor graph. This shouldn't be super hard to do a conservative approximation of. However, as it would all depend on a dependence analysis, things would get trickier when it comes to conditional independence of different array elements (as that requires an array element level dependence analysis, which can be done decently in special cases, but not in general). Note that it is fine, however, to produce a graphical model which is overly conservative in the sense of capturing some but not all independence relationships. This is precisely what happens with dependence analyses as well: they are conservative. We are guaranteed to find a superset of all the actual dependencies in the program.