docs: def resample(self, data, stats=None, mask=None, niter=None):
          """
          Introduce a mask that allows for missing data
          """
          stats = self._get_statistics(data, mask=mask) if stats is None else stats
          stats = self._stats_ensure_array(stats)
  
          niter = niter if niter else self.niter
          for itr in range(niter):
              self._resample_A(stats)
              self._resample_sigma(stats)