It does change for me, though very little.... x = np.random.randn(50) y = x * x * x * x for ddof in range(20): print "ddof = {}; r = {:.20f}".format(ddof, np.corrcoef(x, y, ddof=ddof)[0, 1]) ddof = 0; r = 0.27115960925626320099 ddof = 1; r = 0.27115960925626320099 ddof = 2; r = 0.27115960925626314548 ddof = 3; r = 0.27115960925626320099 ddof = 4; r = 0.27115960925626320099 ddof = 5; r = 0.27115960925626314548 ddof = 6; r = 0.27115960925626320099 ddof = 7; r = 0.27115960925626320099 ddof = 8; r = 0.27115960925626320099 ddof = 9; r = 0.27115960925626320099 ddof = 10; r = 0.27115960925626314548 ddof = 11; r = 0.27115960925626320099 ddof = 12; r = 0.27115960925626320099 ddof = 13; r = 0.27115960925626320099 ddof = 14; r = 0.27115960925626314548 ddof = 15; r = 0.27115960925626314548 ddof = 16; r = 0.27115960925626314548 ddof = 17; r = 0.27115960925626320099 ddof = 18; r = 0.27115960925626320099 ddof = 19; r = 0.27115960925626320099 Cheers 2015-03-10 11:55 GMT-04:00 Alistair Miles <alimanfoo@googlemail.com>:
Hi,
I'm trying to calculate correlation coefficients and looking at the np.corrcoef function. It has bias and ddof arguments, however when I try different values of ddof with test data the results are always the same, i.e., changing ddof has no effect. From some back-of-the-envelope algebra I reckon the n/(n-ddof) normalisations should get cancelled out when calculating correlation coefficients from a covariance matrix, and therefore the ddof (and bias) arguments to np.corrcoef are redundant.
I'd be very grateful if someone could verify this is true or tell me if I've missed something.
Thanks, Alistair -- Alistair Miles Head of Epidemiological Informatics Centre for Genomics and Global Health <http://cggh.org> The Wellcome Trust Centre for Human Genetics Roosevelt Drive Oxford OX3 7BN United Kingdom Web: http://purl.org/net/aliman Email: alimanfoo@gmail.com Tel: +44 (0)1865 287721
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
-- Sasha