A Bayesian network is usually drawn as a directed acyclic graph (DAG) annotated with conditional probability tables. Read categorically, the picture is the mathematics. The graph is the wiring of a string-diagram in a markov-category, each node is a channel, and conditional independence is not a side condition but an equation between diagrams.

Let be a Markov category. A categorical Bayesian network over a finite DAG assigns to each node an object and a channel from the joint of its parents. Composing these channels along a topological order, with each variable copied so it can feed every child, builds a single state , the joint distribution. The assignment can equivalently be packaged as a functor out of the free Markov category on the graph, so that “a Bayesian network” and “a structure-preserving interpretation of the wiring diagram” are the same datum.

Definition. The network as a diagram

The joint factors as a copy/compose pattern. Each node’s output wire is -branched to all of its children, and discarded () where a variable is latent or marginalised. The DAG’s edges are exactly the wires, so there is no data beyond the diagram and the channels labelling its boxes.

Proposition. Conditional independence is a diagram equation

holds in the represented state iff the two diagrams “copy , then run the - and -branches independently” and “run the joint -branch off ” are equal. The graphoid axioms (symmetry, decomposition, weak union, contraction) become derivations by sliding, copying, and discarding wires, so d-separation is a soundness statement about diagram rewriting.

Remark. References

Fong’s thesis casts causal networks as string diagrams in a Markov category and proves a d-separation / factorisation correspondence in this language. Jacobs develops categorical conditional probability (disintegration, Bayesian inversion, and the “channel” calculus of states and effects) that supplies the conditioning these networks need. Both treat the graph as syntax and the Markov category as semantics.

The vector-cone-map reading

The same network collapses to a single linear map between cones, so inference is matrix-vector arithmetic in disguise. Take to be the bounded non-negative measures on . These form a semi-vector space, or vector cone, since they add and scale by non-negative reals but cannot be subtracted. A Markov kernel then becomes a cone-linear map by pushforward of measures, which is exactly Chapman-Kolmogorov integration against the kernel and is defined for non-probability measures just as well as for probability ones. Composing kernels composes these maps, so the whole product of conditionals is one cone-linear map from priors to the joint, rather than the copy/compose diagram of the string-diagram reading.

The machinery contains nothing beyond (semi-)linear algebra. The Dirac embedding sends a state to the point mass concentrated there, and categorically it is the unit of the Giry monad, the canonical inclusion of points into distributions. A deterministic map is then the cone-linear extension of a function on points, so the only thing distinguishing this probabilistic setting from ordinary linear algebra is the missing minus sign.

The empirical distribution is a measure

An observed pair enters as the measure , rather than as a normalized frequency needing subtraction to update. This works over any measurable space, since the cone needs neither subtraction nor topology, and an empirical distribution is just a finite non-negative combination of such products.