Statistical Computing with Coherent Nanophotonic Circuits