14.3 Correlation, Linear Regression, Beta, and Hypothesis Testing Basics
Key Takeaways
Pearson correlation (r) standardizes covariance onto a bounded scale from -1 to +1 and for return co-movement, use aligned returns rather than trending price levels and check stability
Diversification benefits can erode if correlations across risky assets rise during market stress in a phenomenon known as regime breakdown
In simple linear regression, beta equals Cov(X,Y)/Var(X) and measures systematic sensitivity, while with an intercept, R-squared equals r-squared and represents the fraction of variance explained
Technical analysts construct linear regression trend channels by plotting an ordinary least squares centerline flanked by +/-1 or +/-2 standard error bands
Running hundreds of unadjusted backtests inflates Type I error (false positives) through data snooping, making out-of-sample and walk-forward testing mandatory
Quantifying Relationships and Testing Trading Rules
Technical analysis rarely evaluates a single chart in isolation. Intermarket analysts compare equities against bonds and commodities, portfolio managers measure how tightly an equity tracks its benchmark, and system developers test whether an indicator's historical edge reflects genuine market structure or random noise. Correlation, linear regression, and hypothesis testing provide the statistical framework for all three tasks.
Visualizing Data and Screening Outliers
Numerical summaries can hide structure. A histogram shows the frequency distribution (center, dispersion, skew and extreme observations); a box plot summarizes quartiles and extremes. Define the interquartile range (IQR) as Q3 − Q1. The conventional inner fences for potential outliers are Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. For example, Q1 = 2 and Q3 = 6 give IQR = 4, fences −4 and 12, and an observation of 15 is flagged. Investigate whether it is a data error or genuine market event; do not automatically delete real crashes. A scatterplot of paired observations describes direction (positive/negative), form (linear/nonlinear) and strength (concentration around the form); it also exposes clusters and outliers. None of these establishes causation.
Covariance and Pearson Correlation
Covariance
Sample covariance measures how two variables and move together around their respective means:
Positive covariance indicates that and tend to rise and fall together; negative covariance indicates they move inversely. However, covariance is unbounded and expressed in the product of the variables’ units, making it impossible to judge relationship strength from covariance alone.
Pearson Correlation Coefficient ()
Dividing covariance by the product of the two sample standard deviations creates the Pearson correlation coefficient (), a unitless measure bounded between and :
- : Perfect positive linear relationship (assets move proportionally in the same direction).
- : No linear relationship (note that two variables can still share a strong non-linear pattern while registering ).
- : Perfect negative linear relationship in the sample; hedge size and future stability still matter.
Two Critical Traps: Spurious Correlation and Regime Breakdown
- Spurious Correlation: Correlation never proves causation, and in finance it frequently arises from non-stationary price levels. Two completely unrelated assets that both trend upward over twenty years—such as U.S. technology stocks and global cumulative rainfall or consumer price indexes—can exhibit a price-level correlation above . To test genuine co-movement, technicians generally compute correlation on aligned return series (and assess stationarity and stability) (percentage or logarithmic period-over-period changes) rather than raw price levels.
- Regime Breakdown: Asset correlations are not fixed constants. During sudden liquidity panics and risk-off crashes, correlations across normally distinct risky assets—equities, high-yield corporate bonds, commodities, and international markets—may rise. Such regime changes can reduce diversification benefits precisely when a portfolio needs protection.
Simple Linear Regression and Beta
While correlation measures symmetric co-movement, simple linear regression models a directional relationship in which an independent variable (such as market index returns) explains a dependent variable (such as an individual stock's returns):
Here is the intercept, is the slope coefficient, and is the residual error term representing unexplained, asset-specific variation. Ordinary least squares (OLS) minimizes the sum of squared residuals and estimates the slope and intercept as:
Coefficient of Determination ()
In ordinary least squares simple linear regression with an intercept, the coefficient of determination () equals the square of Pearson's correlation () and ranges from to . It specifies the proportion of total variance in explained by linear variation in . For example, if a stock's return correlation with the S&P 500 is , then : of the sample variation in stock returns is accounted for by the fitted linear relationship; the remaining () is unexplained by that regression (not necessarily purely company-specific risk).
Beta as Systematic Sensitivity
When represents a broad market benchmark, the regression slope beta () measures systematic market sensitivity:
- : Moves in line with the market on average.
- (Aggressive): Amplifies market swings. If and , then , meaning a market move corresponds on average to a move in the stock.
- (Lower positive sensitivity): Dampens market swings (typical of utilities or consumer staples, e.g., ).
- : Moves inversely to the benchmark (such as inverse exchange-traded products).
Linear Regression Trend Channels
Technicians also apply simple linear regression directly to price charts by setting time as the independent variable and closing price as . The resulting linear regression line plots the best-fit trend centerline, while its slope expresses trend velocity in price units per bar. Flanking that centerline at or standard errors of the estimate (SEE) forms a standard error channel; a Raff regression channel instead uses the greatest distance from the fitted line to the selected period’s intrabar highs or lows as its symmetric width. Both can help traders visualize trend persistence and spot statistically stretched extensions.
Hypothesis Testing Basics and Data Snooping
When backtesting a technical rule—such as a moving-average crossover—a positive average return in historical data could simply be luck. Hypothesis testing formalizes whether observed performance is statistically distinguishable from random noise.
Core Components
- Null Hypothesis (): The skeptical baseline assuming no effect or no edge (e.g., mean excess strategy return ).
- Alternative Hypothesis (): The claim being tested (e.g., or ).
- Test Statistic and p-value: A standardized score (such as a -statistic) measuring how extreme the sample result is under . The p-value is the probability of obtaining a test statistic at least as extreme as the observed sample assuming and the statistical model assumptions hold—it is not the probability that is true.
- Significance Level (): A pre-chosen threshold (commonly , or ). If under the prespecified rule, reject ; statistical significance alone does not establish economic value.
Type I vs. Type II Errors
| Reality / Decision | Fail to Reject | Reject () |
|---|---|---|
| is True (No Edge) | Correct retention (probability at least for a valid level-alpha test) | Type I Error — False positive (probability at most ) |
| is False (True Edge) | Type II Error — False negative (probability ) | Correct rejection / Power (probability ) |
- Type I Error (False Positive): Rejecting a true null hypothesis—concluding a worthless indicator works and deploying live capital into a losing system.
- Type II Error (False Negative): Failing to reject a false null hypothesis—discarding a genuinely profitable rule because the sample was too short or noisy.
Caution
Multiple-Testing and Data-Snooping Danger: Testing independent parameter combinations on pure random noise at yields an expected "statistically significant" strategies by chance alone (a chance of at least one false positive). Exhaustive backtest optimization without out-of-sample validation, walk-forward testing, or multiple-testing penalties (such as the Bonferroni adjustment ) turns random noise into overfitted Type I illusions.
A quantitative analyst correlates the daily closing price levels of two unrelated industries over 15 years and obtains r = +0.92, even though their daily percentage returns show r = +0.04. What explains the high price-level correlation?
Regime breakdown caused both industries to converge during minor market pullbacks
Spurious correlation arising from correlating two non-stationary trending price series rather than stationary returns
Bessel's correction inflated the price-level covariance relative to the return covariance
High R-squared proves that one industry causes the long-term price trend of the other
In a simple linear regression of a stock's monthly returns against a broad market index, the covariance between the stock and the index is 0.027, the variance of the index is 0.018, and the correlation coefficient is r = 0.70. What are the stock's beta and R-squared?
Beta = 0.67; R-squared = 0.70
Beta = 1.50; R-squared = 0.70
Beta = 0.70; R-squared = 0.49
Beta = 1.50; R-squared = 0.49
A technician tests 200 moving-average combinations on historical data using a 5% significance threshold (alpha = 0.05) and deploys the single best combination without out-of-sample testing. Which statistical risk is most severe in this scenario?
Type II error, because testing 200 rules lowers the chance of rejecting a false null hypothesis
Regime breakdown, because moving averages always correlate at +1.0 across asset classes
Type I error via data snooping, because selecting from many unadjusted tests inflates false-positive risk
Platykurtic distortion, because moving averages eliminate tail risk from the return series
Sections you finish are checked off in the contents.