[BUG] correctly set tags of Hurdle and Truncated depending on inner distribution#569
Conversation
Hurdle and Truncated depending on inner distributionHurdle and Truncated depending on inner distribution
|
see #571, continuous distributions should return 0 for pmf - this should actually be the default? |
|
The "one-off" error from #566 is still present. Any ideas? |
|
Hm, very strange - I see that it tests Poisson for Truncated, I thought I changed all Poisson references to Negative Binomial. What happens if you replace it with NegativeBinomial instead? |
|
that would not fix the error, just "make the tests pass"? |
|
I'll debug and see what's wrong! |
|
Can't seem to reproduce the error: import tqdm
from skpro.distributions import Normal, TruncatedDistribution, Hurdle
import numpy as np
def ppf_and_cdf(d):
capabilities_exact = d.get_tags()["capabilities:exact"]
if "ppf" not in capabilities_exact or "cdf" not in capabilities_exact:
return
x = d.sample()
x_approx = d.ppf(d.cdf(x))
if d.ndim > 0:
assert np.allclose(x.values, x_approx.values)
else:
assert np.allclose(x, x_approx)
cases = TruncatedDistribution.get_test_params()
for i in tqdm.tqdm(range(1_000)):
for case in cases:
dist = TruncatedDistribution(**case)
ppf_and_cdf(dist)Tried bumping to 5,000, still no issue. I'm on scipy==1.16.0 and Python=3.12. Will try to update scipy if see if that's the issue. Edit: No issue |
|
Perhaps we should move the eps fix to truncated instead? |
|
ok, I will try to merge #576 into this and then we see |
This reverts commit ecca172.
|
Sounds good. I had messed up which variable to look at when selecting the eps since I assumed that shifted_p would be an array, hence the failing tests |


This PR correctly sets the tag of
HurdleandTruncateddepending on the inner distribution.Related to #566