Re: the implementation in check_distribution_rvs

Robert Kern <[email protected]> Tue, 9 May 2023 08:29:34 -0400
Newsgroups gmane.comp.python.scientific.devel
Message-ID <CAF6FJiu7+nYsSNYrffLJSH3OAGPkkKPijiMqH07AQ9eRmm4gvw@mail.gmail.com>
On Tue, May 9, 2023 at 8:03 AM <[email protected]> wrote:

> Hi,
>
> I read the code of the function check_distribution_rvs and can't
> understand the logic behind it:
>
> - in the code:
> https://github.com/scipy/scipy/blob/878285cfa3bdaf2abaa3b8f7e51ae4a277d63b33/scipy/stats/tests/test_continuous_basic.py#LL664C5-L664C27
> - in L678: why is "stats.kstest(dist, dist, args=args, N=1000)"? I thought
> it should be "stats.kstest(dist, rvs, args=args, N=1000)"?
>
> because the comments also say "Repeat the test with a new sample of rvs.
> Generate 1000 rvs, perform a K-S test that the new sample of rvs". Did I
> miss something? Thanks.
>

The first `dist` argument will get turned into the appropriate `rvs` method
and get called to generate `N` values.

https://github.com/scipy/scipy/blob/878285cfa3bdaf2abaa3b8f7e51ae4a277d63b33/scipy/stats/_stats_py.py#L8892-L8903

-- 
Robert Kern

_______________________________________________
SciPy-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: [email protected]