Skip to content

Reduce number of test points in slow logcdf methods #4459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pymc3/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,7 @@ def test_beta(self):
Unit,
{"alpha": Rplus, "beta": Rplus},
lambda value, alpha, beta: sp.beta.logcdf(value, alpha, beta),
n_samples=10,
)

def test_kumaraswamy(self):
Expand Down Expand Up @@ -1052,17 +1053,20 @@ def scipy_mu_alpha_logcdf(value, mu, alpha):
Nat,
{"mu": Rplus, "alpha": Rplus},
scipy_mu_alpha_logcdf,
n_samples=5,
)
self.check_logcdf(
NegativeBinomial,
Nat,
{"p": Unit, "n": Rplus},
lambda value, p, n: sp.nbinom.logcdf(value, n, p),
n_samples=5,
)
self.check_selfconsistency_discrete_logcdf(
NegativeBinomial,
Nat,
{"mu": Rplus, "alpha": Rplus},
n_samples=10,
)

@pytest.mark.parametrize(
Expand Down Expand Up @@ -1282,11 +1286,13 @@ def test_binomial(self):
Nat,
{"n": NatSmall, "p": Unit},
lambda value, n, p: sp.binom.logcdf(value, n, p),
n_samples=10,
)
self.check_selfconsistency_discrete_logcdf(
Binomial,
Nat,
{"n": NatSmall, "p": Unit},
n_samples=10,
)

# Too lazy to propagate decimal parameter through the whole chain of deps
Expand Down Expand Up @@ -1423,6 +1429,7 @@ def test_zeroinflatednegativebinomial(self):
ZeroInflatedNegativeBinomial,
Nat,
{"mu": Rplusbig, "alpha": Rplusbig, "psi": Unit},
n_samples=10,
)

# Too lazy to propagate decimal parameter through the whole chain of deps
Expand All @@ -1437,6 +1444,7 @@ def test_zeroinflatedbinomial(self):
ZeroInflatedBinomial,
Nat,
{"n": NatSmall, "p": Unit, "psi": Unit},
n_samples=10,
)

@pytest.mark.parametrize("n", [1, 2, 3])
Expand Down