Contained within this repository is a small function for linear regression. The GNU Scientific Library's implementation of such a thing is most likely better than mine, but that is rather large library that you may not wish to bundle just to use one function. Additionally, you may not wish to use the GPL. Read the comment inside the source code to understand how to use the function.