You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When truncating a Geometric distributions, rand will return different types depending on the bounds chosen. For example, values sampled from truncated(Geometric(0.6); lower = 2) are floats, while values sampled from truncated(Geometric(0.6); upper = 4) are integers.
I guess this is due to
I think the problem are actually quantile and invlogcdf here. For Geometric they should always return an Int. For other distributions (and in particular discrete distributions) typically we ensure that the return type of quantile etc. and the type of the variates match. For instance, for discrete distributions where such calculations are performed with StatsFuns/Rmath we explicitly convert the result to Int.
When truncating a
Geometric
distributions,rand
will return different types depending on the bounds chosen. For example, values sampled fromtruncated(Geometric(0.6); lower = 2)
are floats, while values sampled fromtruncated(Geometric(0.6); upper = 4)
are integers.I guess this is due to
Distributions.jl/src/truncate.jl
Lines 211 to 229 in 7e232ca
quantile
/invlogcdf
in special cases.The text was updated successfully, but these errors were encountered: