This is the mail archive of the gsl-discuss@sourceware.org mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: correlation coefficient


> Yes, sounds like a good idea to me. Go ahead and add it in
> covariance_source.c if you have the 1-pass algorithm.

Ok, added under gsl_stats_correlation. I tested it successfully with
the data set:

x = 9.0e9 + i + 1
y = 9.0e9 - i - 1

for i = 1..100

which normally causes bad codes to fail. Also tested it with
lots of random x/y vectors and compared against the result of:

gsl_stats_covariance(x,y) / (gsl_stats_sd(x) * gsl_stats_sd(y))

all with excellent results - error was below GSL_DBL_EPSILON in all
cases - the test codes in statistics/ aren't really set up for
this type of exhaustive testing...so I just adapted the test that
is in there for the correlation routine.

Patrick Alken


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]