Technical Analysis Studies 
Linear Regression Back to Index



Regression analysis is a way of measuring the relationship between two or more data sets. Linear Regression attempts to explain a relationship using a straight line fit to the data and then extending that line to predict future values.

The most common method for fitting a regression line is the method of least-squares. This method calculates the best-fitting line for the observed data by minimizing the sum of the squares of the vertical deviations from each data point to the line. If a point lies on the fitted line exactly, then its vertical deviation is 0. Since the deviations are squared first and then summed, negative and positive do not cancel each other out. The closer the line calculated sits to the data points, the smaller the sum or "error" of a line.

If you think of this trendline as describing an "equilibrium" price, then any moves above or below the trendline indicates overzealous buyers or sellers. Some ways to use a linear regression line are:

  • Use the line to forecast prices. The forecast will simply be an extension of the line, so trade in the direction of the line. This can give good results when viewed on a long enough time frame. Use caution as there still can be significant drawdowns as prices fluctuate above and below the line.

  • Use the line as a basis and draw two parallel lines above and below it to form a channel. See the entries for Linear Regression Channel for more detail.