Linear Fit routine. This will allow errors on the Y values, and will report chi squared. Borrowed from pamguard, https://sourceforge.net/projects/pamguard/.