def _profile_loglike(self, x):
        """Internal function to calculate and cache the profile likelihood
        """
        x = np.array(x, ndmin=1)

        z = []
        y = []

        for xtmp in x:
            def fn(t): return -self.loglike(xtmp, t)
            ytmp = opt.fmin(fn, 1.0, disp=False)[0]
            ztmp = self.loglike(xtmp, ytmp)
            z.append(ztmp)
            y.append(ytmp)

        self._prof_y = np.array(y)
        self._prof_z = np.array(z)
        self._prof_z = self._prof_z.max() - self._prof_z
        self._prof_interp = castro.Interpolator(x, self._prof_z)
        return self._prof_y, self._prof_z
Internal function to calculate and cache the profile likelihood