Re: the implementation in check_distribution_rvs
Matt Haberland <[email protected]> Tue, 9 May 2023 05:34:51 -0700
| Newsgroups | gmane.comp.python.scientific.devel |
|---|---|
| Message-ID | <CADuxUix8HitXD+hQP=G6FL9EHR8Z=ejyQTDVO+NA83YSfRuEtg@mail.gmail.com> |
It looks like the intent is to perform a one-sample KS test with a fresh random sample. According to the documentation of `kstest`, https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kstest.html if the first argument is the name of a distribution, a sample will be drawn from the distribution before performing the test. When the second argument is the name of a distribution, this distribution's CDF is used for comparison. So to me, it looks like it's doing what it intends to do. If the second argument of `kstest` were `rvs` here, then it would perform a two-sample test between a new random sample from the distribution and the original sample. That does not appear to be the intent. Matt On Tue, May 9, 2023, 5:01 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. > _______________________________________________ > 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] > > _______________________________________________ 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]