The recursion issue was caused by the evaluation of incomplete gamma
functions being recursive. That was changed in PR #14021
<https://github.com/sympy/sympy/pull/14021> which was merged two days ago.
Try to update the branch you are working with (the PR changes another
module, so there should be no merge conflicts.)
Somewhat related: the current approach to Poisson CDF is to compute it by
summing the PDF (symbolically), which results in a decent formula in terms
of lower incomplete gamma function. However that formula has a couple of
flaws: (1) it does not take the floor of x, which leads to wrong output for
fractional x.
>>> cdf(Poisson('x', 5))(0).n()
0.00673794699908547
>>> cdf(Poisson('x', 5))(0.9).n()
0.0350993891118802
(2) It would be simpler and better for numerics to use the upper incomplete
gamma function.
So I suggest adding the Poisson CDF formula from Wikipedia and adding it as
an internal _cdf method to the PoissonDistributionClass. This was recently
done for many continuous distributions (Example
<https://github.com/sympy/sympy/blob/master/sympy/stats/crv_types.py#L1258>),
but not for discrete ones.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/6592d93b-573c-4908-80a2-6468580f872b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.