The Ordered Matrix Dirichlet integrates nicely with the available tools in probabilistic programming. We implement the OMD in a few lines using the probabilistic programming API Pyro [1]}, [2]}.We open-source our code jointly with tutorials and examples on how to use the OMD within popular models. Our construction algorithm only involves the sorting of samples from a Beta distribution. This does not obstruct the computation of gradients [3]} and enables gradient-based optimization methods, such as Hamiltonian Markov Chain Monte Carlo (HMC) and Stochastic Variational Inference (SVI) for posterior inference. To infer posterior parameters, we run the HMC-variant No-U-Turn Sampler (NUTS) [4]}, [5]} to take \(S = 1000\)  posterior after 200 warm-up samples. This takes about 30 minutes on a single NVIDIA TITAN RTX GPU core.
<FIGURE>