I have two lists containing X/Y values which are used to plot points on a graph. The X-values are always sequential (1, 2, 3, 4...) but the Y values can vary.
For example:
var x = new List<int>(new[] {0, 1, 2, 3, 4, 5, 6, 7});
var y = new List<int>(new[] {0, 3, 7, 12, 14, 15, 17, 19});
var avgY = // What goes here?
With these values (the Y-values being more important in this case), how can I calculate the average rate of change linear regression line so that I can plot another "average" line (or "prediction" line if we were to extend the graph)?
