def _ppf(self, q, a, b): output = np.zeros_like(self.a) idx = self.a > 0 if np.any(idx): output[idx] = _norm_isf(q[idx] * self._sb[idx] + self._sa[idx] * (-q[idx] + 1.0)) idx = np.logical_not(idx) if np.any(idx): output[idx] = _norm_ppf(q[idx] * self._nb[idx] + self._na[idx] * (-q[idx] + 1.0)) return output
def _ppf_version_131(self, q, a, b): with np.errstate(divide='raise', over='raise', under='ignore', invalid='raise'): ans = self._get_norms(a, b) _na, _nb, _sa, _sb = ans[:4] ppf = np.where(a > 0, _norm_isf(q * _sb + _sa * (1.0 - q)), _norm_ppf(q * _nb + _na * (1.0 - q))) return ppf