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
Many distributions accept nans but do not produce correct results.
np.random.vonmises(1., np.nan) goes into an infinite loop np.random.geometric(np.nan) returns np.iinfo(np.int).min np.random.poisson(np.nan) returns 0 np.random.negative_binomial returns 0 np.random.logseries returns 2 np.random.noncentral_f(1.0, 2.0, np.nan)' returns the same as np.random.noncentral_f(1.0, 2.0, 1.)since it relies onpoissonwhich returns0`.
Fixing most of these to raise would probably be OK. The only one that is tricky is noncentral_f which needs a nan-guard inserted at the bottom of the rk_noncentral_f so that the stream is preserved (it essentially draws non-sense values and then returns nan`.
Probably not worth fixing these now. They have been fixed in #13163. Related to #13189 since fixing this issue lead to this discovery. That issue is also fixed in #13163, although there is no test for it.
The text was updated successfully, but these errors were encountered:
Many distributions accept nans but do not produce correct results.
np.random.vonmises(1., np.nan)
goes into an infinite loopnp.random.geometric(np.nan)
returnsnp.iinfo(np.int).min
np.random.poisson(np.nan)
returns0
np.random.negative_binomial
returns0
np.random.logseries
returns2
np.random.noncentral_f(1.0, 2.0, np.nan)' returns the same as
np.random.noncentral_f(1.0, 2.0, 1.)since it relies on
poissonwhich returns
0`.Fixing most of these to raise would probably be OK. The only one that is tricky is
noncentral_f
which needs a nan-guard inserted at the bottom of therk_noncentral_f
so that the stream is preserved (it essentially draws non-sense values and then returns nan`.Probably not worth fixing these now. They have been fixed in #13163. Related to #13189 since fixing this issue lead to this discovery. That issue is also fixed in #13163, although there is no test for it.
The text was updated successfully, but these errors were encountered: