Linear Regression RSquared

Advertisement

Introduction

Linear Regression R-Squared is an indicator which is used to ascertain the strength of the dominant market trend. It is one of the indicators calculated by using the Linear Regression technique. This indicator is used to determine the intensity of the rise or fall of the market trend. R-squared provides a means of quantifying the strength of the trend. It is typically used with other indicators such as Linear Regression Slope to confirm the studies and take appropriate actions.

Description of Linear Regression R-Squared

The Linear Regression R-Squared function determines the extent of a linear relationship of a value to time. The more closely prices move in a linear relationship with the passing of time, the stronger the trend. Over a given period, R-squared shows the strength of trend. Linear Regression R-squared (LR-R2) measures the extent of a security's movement that can be explained by the linear regression.

The Linear Regression R-Squared value ranges from 0 to 1. A score of 1.00 would indicate a perfect correlation, whereas a score of 0.00 indicates no correlation between the price and the regression as calculated over the given regression period. In other words, R-squared values show the percentage of prices variations that can be accounted for by linear regression. For example, if the R-squared value over 30 days is at 80%, this means that 80% of the price movement of the stock can be fitted to the linear regression indicator by linear regression data fitting. The other 20% indicates prices that do not fit to the linear regression indicator.

R-squared is typically very useful as a corroborating indicator. Momentum indicators and moving averages need a validation of trend to be effective constantly. R-Squared is often used with the Regression Slope indicator and they work well together. The Slope indicates the overall market trend – i.e. either positive or negative, and the R-Squared indicates the strength.

The Linear Regression R-Squared is a banded oscillator type of indicator. As indicated by the name of the type of indicator, it “oscillates” within a defined band from 0 to 1. In general, the price trend is strong when the R-Squared is high and weak when it is low.

Advertisement

Calculation of Linear Regression R-Squared

The Linear regression statistical technique is used for calculating the value of one dependent variable when one has the values of independent variable or variables M. This is in the form of a straight line which “best fits” the data points of prices available, using the least squares technique. The Linear Regression R-Squared is derived by calculating ratio of the sum of squared difference between the fitted values of the regression line and the mean, to the sum of squared difference between each actual price value and the mean. This is an intense calculation process as it involves calculation of regression lines and their R-Squared value at each bar.

The Linear Regression R-Squared indicator is generally drawn as a line chart below the price chart and not overlaid on the chart itself. In addition, this is usually viewed along with other indicators such as the Linear Regression Slope indicator. This is calculated as follows:

LR R2 = SS (Regression) / SS (Total)

Where:
SS (Regression) = sum of the squared difference between each fitted value of Y on the regression line and the mean of Y. This shows the variation in the fitted values of Y while drawing a fitted regression line.
SS (Total) = sum of the squared difference between each value of Y and the mean of Y. This shows the variation in the values of Y.

Another way to look at this is:

LR R2 = 1 – SS (Error) / SS (Total)

Where:
SS (Error) = SS (Total) – SS (Regression)

In effect, the Linear Regression R-Squared Indicator provides a confidence value which tells us how well the linear regression line is fitting the data at that particular bar. Thus a high value means that the linear regression line represents the price data of the regression period very well. This is important because a corollary to this is that the forecasted price of the stock at that point by the linear regression line is likely to be quite correct (or fitting to the regression line). Therefore, it offers a measure of the correctness of the predicted or forecasted value by the regression line

Specifications

As mentioned above the Linear Regression R-Squared indicator shows a confidence value. The confidence value is determined by the R-Squared critical level and the regression period used for the R-squared calculation. Typically a value of .70 or more is considered to be high confidence level for shorter term regression periods and .40 or more for medium term periods.

Typically the Linear Regression R-Squared is illustrated as a Line chart below the price chart. This is a banded oscillator between 0 and 1. It is usually accompanied with the Linear Regression Slope indicator or another momentum oscillator also drawn below the price chart.

Linear Regression RSquared Stock Trading Indicator

Lengths and timeframes

Linear Regression R-Squared can be used as a leading indicator as it shows high confidence value where the regression line has better fit and therefore market trend is closer to the expected. It is used for measuring the trend strength or weakness and confirming the momentum of the market. The lengths or timeframes used can change depending on the trend being analysed. It can range from 5 days for a short term trend, to 20 days for medium trend to 100 days for a long term trend. Used with momentum indicators, it can highlight good entry and exit points for trading.

Trend identification / Crossovers

R-Squared is very valuable as a confirming indicator. Momentum indicators (for example Stochastics, RSI, CCI, etc.) and moving average indicators need a validation of trend in order to be reliably useful. R-squared offers a way of indicating the intensity of the trend of prices.

As mentioned, R-Squared is used to measure the intensity of the trend and the effectiveness of the Linear Regression Forecast. In other words when the R-Squared has a higher value the stock is trading close to the regression line and in line with expectations. Conversely when the R-Squared has a lower value, it means that the stock is trading randomly at prices far from the linear regression line.

Linear Regression RSquared Stock Trading Indicator

In the chart above, the light green line shows where the Linear Regression Slope has turned positive and the Linear Regression R-Squared has increased above a certain defined level and is rising. This gives a strong positive indication that the stock price will move in the positive direction. The red line indicates where the Slope has turned negative and the R-Squared has also fallen below the level and is falling. This indicates a strong negative market trend.

Advantages

The Linear Regression R-Squared is useful as a confirming indicator. It also has predictive value. It can be used with other indicators for identifying possible entry and exit levels. Since it uses the best fit least squares technique, there is no delay unlike moving averages. The R-Squared indicator can be used to determine the confidence and efficiency of the Linear Regression calculation.

Disadvantages

It is an intensive calculation. It should not be used by itself. The indicator can sometimes provide false positive signals, as a high confidence score does not necessarily mean a 100% probability of price movement being in line with the calculated regression line.