docs: def mag_pmf(matrix):
      """
      Fold full disaggregation matrix to magnitude PMF.
  
      :returns:
          1d array, a histogram representing magnitude PMF.
      """
      nmags, ndists, nlons, nlats, neps = matrix.shape
      mag_pmf = numpy.zeros(nmags)
      for i in range(nmags):
          mag_pmf[i] = numpy.prod(
              [1. - matrix[i, j, k, l, m]
               for j in range(ndists)
               for k in range(nlons)
               for l in range(nlats)
               for m in range(neps)])
      return 1. - mag_pmf