<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">What's the definition or interpretation of the weights?</blockquote><div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Just out of curiosity: What is the significance of the 
weights?  If you are trying to represent the fact that distributional 
differences are more important in some regime than in another, e.g., you
 care more about the tails, then using weights is probably not the right
 approach</div></blockquote><div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>I briefly skimmed parts of the Monahan chapter and that is specific
 for importance sampling weights. In that case choosing the weights 
should just compensate for the unequal sampling of points. So maybe in 
that case the distribution of the KS (or AD) test statistic might not 
change much.</div></blockquote><div><br></div><div>The weights are sample weights, indicating the relative frequency of observations. My specific use case is in particle physics where studies often involve simulated data. Certain particle physics processes may have a large amount of simulated data available, but in reality we expect them to be very rare so sample weights are used to compensate.<br><br></div><div>Corin<br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 22 April 2018 at 14:29,  <span dir="ltr"><<a href="mailto:josef.pktd@gmail.com" target="_blank">josef.pktd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Sat, Apr 21, 2018 at 11:15 PM, Phillip Feldman <span dir="ltr"><<a href="mailto:phillip.m.feldman@gmail.com" target="_blank">phillip.m.feldman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Just out of curiosity: What is the significance of the weights?  If you are trying to represent the fact that distributional differences are more important in some regime than in another, e.g., you care more about the tails, then using weights is probably not the right approach.</div></blockquote><div><br></div></span><div>I don't remember for sup tests like KS, but for integral tests like Anderson-Darling there are variations of the test that use different weights to emphasize different regions of the distribution, e.g. Cramer-Von Mises uses different weights than AD</div><div><a href="https://en.wikipedia.org/wiki/Anderson%E2%80%93Darling_test" target="_blank">https://en.wikipedia.org/wiki/<wbr>Anderson%E2%80%93Darling_test</a><br></div><div><br></div><div><br></div><div>I briefly skimmed parts of the Monahan chapter and that is specific for importance sampling weights. In that case choosing the weights should just compensate for the unequal sampling of points. So maybe in that case the distribution of the KS (or AD) test statistic might not change much.</div><div><br></div><div>In either case, I think the distribution of the test statistic depends on the meaning or interpretation of the weights.</div><div><br></div><div>Josef</div><span class=""><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-3232076921425661149gmail-h5">On Sat, Apr 21, 2018 at 4:42 PM, Corin Hoad <span dir="ltr"><<a href="mailto:corinhoad@gmail.com" target="_blank">corinhoad@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_-3232076921425661149gmail-h5"><div dir="ltr">Hello developers,<br><br>I recently needed an implementation of the Kolmogorov-Smirnov 2 sample test which required the incorporation of a weight associated with each element of the data.  This lead me to this stackexchange answer <a href="https://stats.stackexchange.com/questions/193439/two-sample-kolmogorov-smirnov-test-with-weights" target="_blank">https://stats.stackexchange.co<wbr>m/questions/193439/two-sample-<wbr>kolmogorov-smirnov-test-with-w<wbr>eights</a> where a procedure for a weighted 2-sample KS test is taken from Numerical Methods of Statistics by Monohan.<br><br>My current implementation of this can be found here:<br><br><a href="https://github.com/brunel-physics/tact/blob/2b0ee2a28a30f014b103319118b64be52070f001/tact/metrics.py#L198" target="_blank">https://github.com/brunel-phys<wbr>ics/tact/blob/2b0ee2a28a30f014<wbr>b103319118b64be52070f001/tact/<wbr>metrics.py#L198</a><br><br>Would there by any interest in incorporating this functionality into scipy?<br><br>Yours,<br><br>Corin Hoad<br><br></div>
<br></div></div><span class="m_-3232076921425661149gmail-">______________________________<wbr>_________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@python.org" target="_blank">SciPy-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scipy-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/scipy-dev</a><br>
<br></span></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@python.org" target="_blank">SciPy-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scipy-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/scipy-dev</a><br>
<br></blockquote></span></div><br></div></div>
<br>______________________________<wbr>_________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@python.org">SciPy-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scipy-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scipy-dev</a><br>
<br></blockquote></div><br></div>