Diagramming and visualising graphical models

my need for this is conditionally dependent upon my deadline, given the subject matter

On the art and science of algorithmic line drawings for representing graphical models. This is nearly flowchart-like but there are are couple of things I would like handled automatically, such as plate-notation and maybe even automation given a model, and handling of inline mathematical markup.

As always I would like these to export to a modern compatible vector format which means SVG, PDF or as a fallback one of these other formats that can be converted to the above to, such as Adobe Illustrator, EPS or xfig.


HOWTO diagramming convnets using matplotlib in python Or: daft-pgm:

Daft is a Python package that uses matplotlib to render pixel-perfect probabilistic graphical models for publication in a journal or on the internet. With a short Python script and an intuitive model-building syntax you can design directed (Bayesian Networks, directed acyclic graphs) and undirected (Markov random fields) models and save them in any formats that matplotlib supports (including PDF, PNG, EPS and SVG).


Do it in your browser II! daggity:

DAGitty is a browser-based environment for creating, editing, and analyzing causal models (also known as directed acyclic graphs or causal Bayesian networks).

ggdag extend daggity for use in the ggplot ecosystem. Shonydag provides a web interface.


TETRAD is less for sketching idealised DAGs than for visualising and calculating giant empirical DAGs. It’s written by eminent causality inference people.

Tetrad is a program which creates, simulates data from, estimates, tests, predicts with, and searches for causal and statistical models. The aim of the program is to provide sophisticated methods in a friendly interface requiring very little statistical sophistication of the user and no programming knowledge. It is not intended to replace flexible statistical programming systems such as Matlab, Splus or R. Tetrad is freeware that performs many of the functions in commercial programs such as Netica, Hugin, LISREL, EQS and other programs, and many discovery functions these commercial programs do not perform.

Tetrad is limited to models of categorical data (which can also be used for ordinal data) and to linear models ("structural equation models’) with a Normal probability distribution, and to a very limited class of time series models. The Tetrad programs describe causal models in three distinct parts or stages: a picture, representing a directed graph specifying hypothetical causal relations among the variables; a specification of the family of probability distributions and kinds of parameters associated with the graphical model; and a specification of the numerical values of those parameters.


dagR does R

After initializing a new DAG using a command line, the researcher can evaluate what associations are introduced by adjusting for covariables. Potentially biasing paths from exposure to outcome can be identified (see eFig. 1, http://links.lww.com/EDE/A395 demonstrating harmful adjustment using an example DAG from Fleischer and Diez Roux3). Functions to conveniently add or remove nodes and arcs are included, as is a function checking introduced associations and biasing paths for all possible adjustment sets […] The graphics capabilities of R allow fairly straightforward programming of basic DAG drawing routines, while also supporting the interactive repositioning of nodes and arcs.


graphviz is nearly good, in that it supports graphing arbitrary networks, including DAGs. Inevitably, none of its fancy algorithms ever lay it out quite like I want. There is a macOS gui and a cross-platform (WX) gui called doteditor.


  • Laura Dietz and Jaakko Luttinen made tikz macros for doing this in LaTeX, tikz-bayesnet


  • Do it in your browser! mermaid supports easy diagrams with a syntax that aspires to be so basic that it is easier than point and click. Integrates with many markdown editors. Has an online editor, and a CLI