Glossary index › L

Linear Regression

Linear regression is a statistical technique that finds the straight line that best fits a set of data points, describing the relationship between an independent variable (the input, often time) and a dependent variable (the output, often price). The line is calculated using the "least squares" method, which minimizes the total squared distance between the line and every actual data point, giving a single best-fit trend line through what might otherwise look like scattered, noisy data.

In trading platforms, a linear regression line drawn across, say, 50 days of a stock's closing prices produces an objective trend line with a defined slope (how steep the trend is) and an equation that can be extended forward to project where price "should" be if the trend continues unchanged. If a stock's 50-day linear regression line has a slope showing an average gain of $0.80 per day and the current price is $120, the line projects to roughly $124 five trading days later - not a prediction of certainty, but a mathematically objective baseline, in contrast to a hand-drawn trendline that varies from one trader to the next.

A closely related tool is the linear regression channel, which plots parallel lines a set number of standard deviations above and below the central regression line, creating a statistical "normal range" for price. Traders use a break above or below this channel as a signal that price is moving unusually far from its recent statistical trend - potentially signaling either an accelerating trend or an overextended, mean-reversion-prone move.

Linear regression is also the mathematical basis for calculating beta, the measure of how much a stock or asset tends to move relative to a broader index - beta is literally the slope of the regression line when you plot a stock's daily returns against the market's daily returns. The method is general statistics rather than market analysis, which is why charting platforms offer it as a built-in drawing tool and why the same arithmetic sits underneath beta, factor models and a great deal of academic finance. What changes between one application and the next is not the calculation but what is put on each axis, and that choice is where the judgement actually is.

The channel drawn around the line deserves more scepticism than it usually receives, because the word standard deviation imports a statistical guarantee that the underlying method does not deliver here. Least squares produces its best results when the deviations from the line are independent of one another, roughly equal in size across the window, and unrelated to what came before. Price series violate all three in the same characteristic way: large deviations arrive in clusters, they are much larger in volatile periods than in calm ones, and today's is strongly related to yesterday's. The fitted line itself survives this reasonably well, since it is only describing the average direction of the window. The bands do not, because their width is computed as though the errors behaved. In practice price spends noticeably more time outside a two deviation channel than the arithmetic behind the number would suggest, which matters to anyone treating a touch of the outer band as a rare event.

What is linear regression? A method for finding the straight line that best fits a set of points, describing how one variable moves with another, usually price against time.
How is the line chosen? By least squares, which minimises the total squared distance between the line and every observation, producing one objective best fit through noisy data.
What does it give a trader? A trend line with a defined slope and an equation, in contrast to a hand-drawn line that differs from one person to the next.
Can you show it? A fifty-day fit with a slope of 0.80 a day from a current price of 120 projects to roughly 124 five days later, as a mechanical baseline rather than a forecast.
What is a regression channel? Parallel lines placed a set number of standard deviations above and below the fitted line, treated as a normal range, with breaks read as unusual distance from the recent trend.
Where else does it appear? In beta, which is literally the slope of a regression of an asset's returns against the market's.
How solid are those standard deviations? Less than the word statistical suggests, because the method assumes things price series do not do. Least squares assumes the errors are independent, similarly sized throughout, and unrelated to each other, and price deviations are none of those: they cluster, they grow in volatile periods and shrink in calm ones, and today's is closely related to yesterday's. The line itself is a fair description of the average direction. The channel drawn around it inherits assumptions that do not hold, which is why price sits outside a two-deviation channel far more often than the arithmetic implies.

By InsiderTicker Editorial Team · Last updated