I'm using Math.net and C# for simple linear regression of two double arrays (XValues, YValues) which contain physiological data. There are good grounds for constraining the intercept to the origin. At the moment I'm using:
Tuple<double, double> r = Fit.Line(XValues, YValues);
double YIntercept = r.Item1;
double Slope = r.Item2; ...etc.
Can anyone provide the code snippet to force the regression line to pass through zero. - I am not able to understand the answer provided in the only relevant question on StackOverflow