[SciPy-Dev] contribute wald-wolfowitz runs test to scipy.stats

josef.pktd at gmail.com josef.pktd at gmail.com
Tue Dec 16 10:19:09 EST 2014


On Sun, Dec 14, 2014 at 10:12 PM, Warren Weckesser <
warren.weckesser at gmail.com> wrote:

> On 12/13/14, Warren Weckesser <warren.weckesser at gmail.com> wrote:
> > On 12/12/14, Parke Loyd <parke.loyd at gmail.com> wrote:
> >> Hi,
> >>
> >> I wrote a bit of code that computes the test statistic and p-value for
> >> the
> >> wald-wolfowitz runs test. Seems like it would fit nicely alongside the
> >> other statistical tests in the stats module (ansari, bartlett, ...). The
> >> code is currently available here
> >> <https://github.com/parkus/mypy/blob/master/statsutils.py> -- the
> >> function
> >> named runstest.
> >>
> >> The code works for my purposes, but I expect there is still much to be
> >> done
> >> before it will be ready for a pull request. Per the guide on
> contributing
> >> to SciPy, I figured I would get the conversation started to find out
> >> whether the community thought it a worthwhile contribution before making
> >> the effort to get it ready for a PR.
> >>
> >
> >
> > Parke,
> >
> > The Wald-Wolfowitz test would be a nice addition to scipy.  If you
> > create a pull request, I hope Josef P. can help review it.  I probably
> > won't be able to do much more than a cursory review until January.
> >
>
>
> It doesn't mean we can't have it in scipy, but I see that  statsmodels
> has the Wald-Wolfowitz runs test in their sandbox:
>
> https://github.com/statsmodels/statsmodels/blob/master/statsmodels/sandbox/stats/runs.py


only the modules are located in the sandbox (*). The functions are
"official" (included in the api.py) and reasonably tested AFAICS
http://statsmodels.sourceforge.net/devel/stats.html#non-parametric-tests


I haven't looked at those in a long time.
According to the docstring, SAS has a "more exact" tie handling. I tried
for a while to figure out the exact distributions of various runs processes
and statistics but then gave up because it was taking too much time given
my priorities.

(*) some modules where my ambition was greater than my patience are still
located in the sandbox even though the main functions are tested and
"official".

Josef


>
>
> Josef would probably know the status of the statsmodels version of the
> test.
>
> Warren
>
>
> > Warren
> >
> >
> >> Best,
> >> Parke
> >>
> >
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20141216/66dff45f/attachment.html>


More information about the SciPy-Dev mailing list