Skip to content

Commit 508a134

Browse files
authored
Allow customizing truncation max_n_steps in Hurdle Mixtures
1 parent 7d15175 commit 508a134

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymc/distributions/mixture.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ def dist(cls, psi, mu=None, alpha=None, p=None, n=None, **kwargs):
798798
)
799799

800800

801-
def _hurdle_mixture(*, name, nonzero_p, nonzero_dist, dtype, **kwargs):
801+
def _hurdle_mixture(*, name, nonzero_p, nonzero_dist, dtype, max_n_steps=10_000, **kwargs):
802802
"""Helper function to create a hurdle mixtures
803803
804804
If name is `None`, this function returns an unregistered variable
@@ -819,7 +819,7 @@ def _hurdle_mixture(*, name, nonzero_p, nonzero_dist, dtype, **kwargs):
819819
weights = pt.stack([1 - nonzero_p, nonzero_p], axis=-1)
820820
comp_dists = [
821821
DiracDelta.dist(zero),
822-
Truncated.dist(nonzero_dist, lower=lower),
822+
Truncated.dist(nonzero_dist, lower=lower, max_n_steps=max_n_steps),
823823
]
824824

825825
if name is not None:

0 commit comments

Comments
 (0)