fast & efficient least squares fit algorithm in C?
Try this code. It fits y = mx + b to your (x,y) data. The arguments to linreg are linreg(int n, REAL x[], REAL y[], REAL* b, REAL* m, REAL* r) n = number of data points x,y = arrays of data *b = output intercept *m = output slope *r = output correlation coefficient … Read more