So I'm still wrapping my head around some of the math (I haven't had a math class in a handful of years)... I get the output of the model (y_model = m*xs[i]+b), it's the y = mx + b where we know x (from the dataset) and have y be a variable. The error is where I start to lose it, so I get the idea of the first part (ys[i]-y_model). It's basically the difference between the actual y value (from the dataset). I get tha…
The following answer is about standard deviation but the desired properties from squaring is also relevant to your question:
http://stats.stackexchange.com/questions/118/why-square-the-...