Statistical modelling of the cosmological dispersion measure