Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Multiplying the x data by some factor won't really change the Spearman rank-order correlation coefficient, though.</p> <pre><code>&gt;&gt;&gt; x = numpy.random.uniform(-10,10,size=(20)) &gt;&gt;&gt; y = numpy.random.uniform(-10,10,size=(20)) &gt;&gt;&gt; scipy.stats.spearmanr(x,y) (-0.24661654135338346, 0.29455199407204263) &gt;&gt;&gt; scipy.stats.spearmanr(x*10,y) (-0.24661654135338346, 0.29455199407204263) &gt;&gt;&gt; scipy.stats.spearmanr(x*1e6,y) (-0.24661654135338346, 0.29455199407204263) &gt;&gt;&gt; scipy.stats.spearmanr(x*1e-16,y) (-0.24661654135338346, 0.29455199407204263) &gt;&gt;&gt; scipy.stats.spearmanr(x*(-2),y) (0.24661654135338346, 0.29455199407204263) &gt;&gt;&gt; scipy.stats.spearmanr(x*(-2e6),y) (0.24661654135338346, 0.29455199407204263) </code></pre> <p>(The second term in the tuple is the p value.)</p> <p>You can change its sign, if you flip the signs of the terms, but the whole point of Spearman correlation is that it tells you the degree to which <em>any</em> monotonic relationship would capture the association. Probably that explains why fmin isn't changing the multiplier much: it's not getting any feedback on direction, because the returned value is constant.</p> <p>So I don't see how what you're trying to do can work.</p> <p>I'm also not sure why you've chosen the sum of all the the Spearman coefficients and the p values as what you're trying to maximize: the Spearman coefficients can be negative, so you probably want to square them, and you haven't mentioned the p values, so I'm not sure why you're throwing them in.</p> <p>[It's possible I guess that we're working with different scipy versions and our spearmanr functions return different things. I've got 0.9.0.]</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload