code: def _posterior(self, x):
          
          yedge = self._nuis_pdf.marginalization_bins()
          yc = 0.5 * (yedge[1:] + yedge[:-1])
          yw = yedge[1:] - yedge[:-1]
  
          like_array = self.like(x[:, np.newaxis], yc[np.newaxis, :]) * yw
          like_array /= like_array.sum()
  
          self._post = like_array.sum(1)
          self._post_interp = castro.Interpolator(x, self._post)
          return self._post
docs: Internal function to calculate and cache the posterior