  We present a complete numerical treatment of inflationary dynamics under the
influence of stochastic corrections from sub-Hubble modes. We discuss how to
exactly model the stochastic noise terms arising from the sub-Hubble quantum
modes that give rise to the coarse-grained inflaton dynamics in the form of
stochastic differential equations. The stochastic differential equations are
solved event-by-event on a discrete time grid. We then compute the power
spectrum of curvature perturbations that can be compared with the power
spectrum computed in the traditional fashion using the Mukhanov-Sasaki equation
by canonically quantizing the inflaton fluctuations. Our numerical procedure
helps us to easily extend the formalism to ultra slow-roll inflation and study
the possibility of primordial black hole formation.
