  We introduce a graphical framework for Bayesian inference that is
sufficiently general to accommodate not just the standard case but also recent
proposals for a theory of quantum Bayesian inference wherein one considers
density operators rather than probability distributions as representative of
degrees of belief. The diagrammatic framework is stated in the graphical
language of symmetric monoidal categories and of compact structures and
Frobenius structures therein, in which Bayesian inversion boils down to
transposition with respect to an appropriate compact structure. We characterize
classical Bayesian inference in terms of a graphical property and demonstrate
that our approach eliminates some purely conventional elements that appear in
common representations thereof, such as whether degrees of belief are
represented by probabilities or entropic quantities. We also introduce a
quantum-like calculus wherein the Frobenius structure is noncommutative and
show that it can accommodate Leifer's calculus of `conditional density
operators'. The notion of conditional independence is also generalized to our
graphical setting and we make some preliminary connections to the theory of
Bayesian networks. Finally, we demonstrate how to construct a graphical
Bayesian calculus within any dagger compact category.
