def test_kipping13_bounds(self, kwargs): with self._model(): kipping13("ecc", **kwargs) trace = self._sample() ecc = trace["ecc"].flatten() assert np.all((kwargs.get("lower", 0.0) <= ecc) & (ecc <= kwargs.get("upper", 1.0)))
def test_kipping13_short(self): with self._model(): kipping13("ecc", fixed=True, long=False, shape=4) trace = self._sample() ecc = trace["ecc"].flatten() assert np.all((0 <= ecc) & (ecc <= 1)) cdf = lambda x: beta.cdf(x, 0.697, 3.27) # NOQA s, p = kstest(ecc, cdf) assert s < 0.05
def test_kipping13_long(self): with self._model(): kipping13("ecc", fixed=True, long=True, shape=3) trace = self._sample() ecc = trace["ecc"].flatten() assert np.all((0 <= ecc) & (ecc <= 1)) cdf = lambda x: beta.cdf(x, 1.12, 3.09) # NOQA s, p = kstest(ecc, cdf) assert s < 0.05
def test_kipping13(self): with self._model() as model: dist = kipping13("ecc", shape=(5, 2)) assert "ecc_alpha" in model.named_vars assert "ecc_beta" in model.named_vars # Test random sampling samples = dist.random(size=100) assert np.shape(samples) == (100, 5, 2) assert np.all((0 <= samples) & (samples <= 1)) trace = self._sample() ecc = trace["ecc"] assert np.all((0 <= ecc) & (ecc <= 1))