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]

correlation coefficient


Hi,

  Is there any interest in putting a new function in the
statistics area for calculating the Pearson correlation coefficient?
I think this can be done safely in gsl by just using

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

but it would be more efficient to calculate everything in 1 pass
through the data and I believe there is a stable algorithm to do
this (similar to how the mean/variance is calculated). This is
such a common function for people who work with data so I think
it'd be nice to have it in gsl :)

Patrick Alken


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