# Correlation Concepts

This is a discussion of some of the basic concepts of correlation.  It is written to provide a background reference to articles written and to be written analyzing various economic and financial relationships.

There are two parameters associated with the use of correlation.  One of these is the quality of agreement in direction between two variables and is represented by something called the correlation coefficient.  The other property is called magnitude of correlation.

Section 1:  Correlation Coefficient

From Wikipedia, the correlation coefficient (r) is defined mathematically by where the xi are all the n values of a function A and yi the corresponding values of a function B.  The x-bar and y-bar values are the means for the respective function values.  The variables sx and sy are the standard deviations (also called the 1-sigma values) of the distribution of values for A (x’s) and B (y’s).

Correlation coefficients can be calculated in spread sheet programs, such as Microsoft Excel, for any two equal length arrays of numbers where the numbers are paired according to a third factor they have in common, such as time.  An example of such a pair of linked arrays is stock prices for A and B for the same days.  Excel has a function CORREL(arrayA,arrayB) to calculate the correlation coefficient, r.

The equation above can be intimidating to a non-mathematician.  However, the value of r can be interpreted without detailed analysis of that equation or a number of others that are equally or more complex.

The correlation coefficient can be understood by the following thought process.  If we are comparing two functions, A and B, if every time A increases B increases (and every time A decreases B decreases), the correlation is said to be perfect and the correlation coefficient is equal to 1.

As the number of instances increases in one function are not matched by increases in the other the correlation coefficient decreases.  When exactly half of the increases in A are matched by increases in B the there is no correlation and the correlation coefficient equals zero.

As the number of increases in A without matching increases in B, the correlation coefficient becomes negative.  When the condition finally gets to no increases in A having matching increases in B the correlation coefficient equals -1.  This situation is called perfect negative correlation.

Section 2:  Magnitude of Correlation

The sympathetic direction of change of paired variables (indicated by the correlation coefficient, r) is not the only factor of importance for understanding the relationship between the two arrays.  It is also important to know the relationship between the magnitudes of changes in one array to the other.  How much of a change in B is indicated for any given change in A?

The values for elements of A and B paired by trading date can be plotted on x, y coordinates.  The equation of the linear or curvilinear regression line fitting the data points yields an R2 value for each regression.  This R2 is the square of the correlation coefficient r.  The comparison between the R2 values for a least squares best quadratic fit and a best linear fit are usually close in value, indicating that a linear trend line is an acceptable estimate.  The slope of the linear trend line is related to the magnitude of the correlated changes in A and B.

The calculation of magnitude of correlations will be demonstrated in the following sections.

Section 3:  Test Case Examples

The following table lists four simple pairs of arrays selected to illustrate variety in both correlation coefficient and in magnitude. The following graph shows the plot of A (x-axis) against B (y-axis). Some observations:

1.  R2 is slightly larger for the quadratic fit than for the linear.  To the extent the difference has any significance; it indicates that A has a tendency to increase slightly faster as B gets larger.  However, the small difference in R2 values here should not be significant.
2. The relationship between slope in the graph and size of increase in B for a unit increase in A on a relative (percentage) basis is called the magnitude (B/A).  The formula is derived from the process of normalizing the two scales (x and y) so that the slope, in dollar terms, is converted to a percent change value.  The slope is given by Δy / Δx.  However, Δy of a dollar is much more important if it occurs from a reference of \$10 (10% change) than if it occurs from a reference of \$100 (1% change).  To have the slope represent the percent changes, the equation for slope can be written:

Slope (normalized) = (Δy/y) / (Δx/x) = (x/y) * (Δy/Δx) =     (x/y)  * Slope (not normalized)

Slope (not normalized) is given in a ratio of dollars; slope (normalized) is given in a ratio of percent changes.

1. Approximate values for normalization are the midpoint of the range of the x-axis data and the midpoint of the range of the y-axis data.
2. The magnitude (B/A) is the inverse of the magnitude (A/B).  If a value of magnitude greater than 1 is obtained, it is convenient to reverse the assignments of x- and y- so that we always deal with magnitudes equal to or less than 1.00.
3. In the above graph, the linear equation tells us that an increase of 1 in A has corresponded to an increase of 1.0192 in B.  Normalization tells us that an increase of 1% in A has corresponded to an increase of 1.25% in B; 10% in A is 12.5% in B; 20% in A is 25% in B; etc.

The next graph shows the relationships when there are significantly different scales on the x- and y- axes. In the following graph the R2 value for the quadratic is significantly larger than for the linear trend line.  In this case it appears that, as the values of A become larger, the tendency of  B to decline becomes less.  Even in such cases as this I still use the linear fit for analysis.  I have not seen differences in R2  values much larger than this.  If such an occasion does arise, I have not yet determined how it should be handled. The next graph shows a quality of correlation not often found when looking a data over time periods of several months and longer.  This is exceptional correlation, at least for stock prices. The final graph in this section is a repeat of the graph before the previous one.  This has the process shown for determining the dollar value of Δy using the normalized magnitude and the other parameters in the analysis. Section 4:  Characterization of Correlation

The following graphic illustrates the author’s characterization of the quality of correlation.  These definitions are arbitrary and may be revised in the future. Section 5:  Some Examples of Correlation Plots Using ETFs

The following four graphs show examples of different degrees of correlation, from weak to excellent.  The first shows an example where there has been weak correlation. The trend lines are sloping upward so there is a positive correlation between EWC (Canada) and EWU (UK).  If there was negligible correlation the trend lines would be nearly horizontal and negatively sloped (downward) if the correlation was negative.  The quality of the correlation is  weak, indicated by R2 = 0.286 (r = 0.53).

The magnitude (EWU/EWC) is 0.53.  (Note:  the magnitude and correlation coefficient both being 0.53 is pure coincidence.)  The magnitude is calculated as follows:

M(EWY/EWC)  =  slope * mx / my  =  0.3176 * 26.55 / 15.90  =  0.5303

where

slope is obtained from the regression line in the correlation plot;                                             mis the midpoint of the EWC prices (x-axis data); and                                                              mis the midpoint of the EWU prices (y-axis data).

The magnitude tells us that EWU has had less price sensitivity than EWC.  Every 5.3% gain in EWU has corresponded to a 10% gain in EWC.  There was a lot of variability in that relationship, however.  The correlation between the two price movements was weak. The correlation between FXI and SPY is borderline between weak and fair (r = 0.70).  The magnitude is 0.94.  For a 10% change in SPY there has been, on average, a 9.4% change in FXI, although the daily correlations are weak to fair.  The slight downward curvature of the quadratic trend line reveals that the tendancy for FXI to rise as SPY increases diminshes slightly as prices rise.

In the following graph we see an example of fair correlation (r = 0.77).  The downward curvature of the quadratic trend line shows that as FXI has risen in price the increases in EWJ have slowed.  The average for the entire data group is 4.3% increase for EWJ for every 10% rise in FXI (magnitude = 0.43). If the curvature in the quadratic trend line were recognized in real time, an allocation advantage could be realized.  When FXI is in the range of 37 to 39, the rate of increase in EWJ is 7.8% for every 10% gain in FXI.  When FXI is in the range of 42.5 to 44.5, the rate of increase in EWJ is 2.1% for every 10% gain in FXI.

If this behavior could be followed in real time, allocation to EWJ could be reduced and allocation to FXI could be increased as FXI advanced in price.

Next an example comparing SPY with EWJ shows good correlation (r = 0.84). The magnitude is 1.16.  If the x- and y- axes are reversed the magnitude would be 0.86.  Either way, EWJ has gained an average of 8.6% for 10% gain in SPY.  The slight curvature of the quadratic trend line (green) reveals that the change in EWJ relative to SPY has been quite uniform over the sample period.

Perhaps it is surprising that Germany (EWG) and Brazil (EWZ) have had very good correlation as shown in the next graph, with r = 0.93. The magnitude of this correlation is 0.79.  The increase in EWG averaged 7.9% for every 10% rise in EWZ.  The green and red trend lines are very close except at low prices.  The green line curvature in the lower left corner appears to be largely due to one data point.

An excellent correlation has been shown by Canada (EWC) and The U.S. (SPY), with r = 0.96. The magnitude of  1.29 indicates that, on average, EWC has risen 12.9% for a 10% rise in SPY.  Following the convention that correlation plots are best made so that the magnitude is 1 or less, the graph could be plotted with the axes reversed.  For that graph the magnitude would be 0.78 and the relationship between the two ETFs would be stated that a rise of 7.8% has occurred for SPY (on average) for a rise of 10% in EWC.

Note:  The correlations given as examples here are for specific time periods.  There is no reason to assume that these relationships would apply to any other time period.  The time variation of correlations is an ongoing project and will be reported on as work is completed.