The Question in Interest

When German stock market (DAX) has a good or bad day, does the French market (CAC 40) tend to do the same?

  • Data: daily closing prices of four European indexes, 1991 to 1998
  • Built into R as EuStockMarkets
  • Tools: correlation and simple linear regression

The Data

First 6 days of daily log returns
DAX SMI CAC FTSE
-0.0093 0.0062 -0.0127 0.0068
-0.0044 -0.0059 -0.0187 -0.0049
0.0090 0.0033 -0.0058 0.0090
-0.0018 0.0015 0.0087 0.0058
-0.0047 -0.0089 -0.0051 -0.0072
0.0124 0.0067 0.0117 0.0085

We use returns (daily % change). Prices trend upward over time. The problem is that this may make two series look related when they are not.

Math/Computing: Log Returns Formula

For an index with closing price \(P_t\) on day \(t\), the daily log return is

\[R_t = \ln\left(\frac{P_t}{P_{t-1}}\right)\]

  • A return of 0.01 means that there is about a 1% gain that day
  • We have 1859 daily returns for each index

Math Computing: Correlation Formula

The sample correlation between DAX returns \(x\) and CAC returns \(y\) is

\[r = \frac{\sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y})}{\sqrt{\sum_{i=1}^{n}(x_i-\bar{x})^2}\,\sqrt{\sum_{i=1}^{n}(y_i-\bar{y})^2}}\]

  • \(r\) is always between \(-1\) and \(1\)
  • Approximately 1 means the two variables move up and down together
  • Approximately 0 means there is no linear relationship between these variables

Math Computing: Regression Formula

\[Y_i = \beta_0 + \beta_1 x_i + \varepsilon_i, \qquad \varepsilon_i \sim N(0, \sigma^2)\]

  • \(Y_i\): CAC (French stock) return on day \(i\), \(x_i\): DAX return on day \(i\)
  • \(\beta_1\) is the slope. In the finance domain, this is called the beta
  • If \(\beta_1 = 0.5\), a 1% change in the DAX (German stock) goes with about a 0.5% move in the CAC

This results in a 95% confidence interval. It is represented by the following formula to compute the slope.

A 95% confidence interval for the slope is

\[\hat\beta_1 \pm t_{n-2,\,0.975}\cdot SE(\hat\beta_1)\]

R Code

# daily log returns 
returns <- as.data.frame(diff(log(EuStockMarkets)))

# correlation and regression
cor.test(returns$DAX, returns$CAC)
fit <- lm(CAC ~ DAX, data = returns)
summary(fit)
confint(fit)

# plot using ggplot library 
ggplot(returns, aes(x = DAX, y = CAC)) +
  geom_point(alpha = 0.3) +
  geom_smooth(method = "lm")

Plot 1: DAX vs CAC Returns

Each dot is one trading day. The upward slope means the two markets move in the same direction on most days.

Plot 2: Prices Over Time

Both indexes rose together over the 1990s, but the DAX (German stock) grew faster.

Generate Plot for Three Markets

Drag to rotate. It is stretched along one diagonal, so all three markets tend to move together.

Results of the correlation and linear regression model

  • Correlation: \(r\) = 0.73 (95% CI: 0.71 to 0.75)
  • Estimated slope (beta): 0.79
  • 95% CI for the slope: (0.75, 0.82)
  • \(R^2\) = 0.54, so DAX (German stock) returns explain about 54% of the variation in CAC returns
  • the p-value for the slope is below 0.001

What Did We Learn?/ Reflection

  • The DAX (German stock) and CAC (French stock) have a strong positive relationship day to day
  • A 1% change in the DAX goes with roughly a 0.79% move in the CAC
  • About 46% of the CAC’s movement is not explained by the DAX
  • Limitations of model: the data ends in 1998, and correlation does not show that one market causes the other
  • Next steps: add FTSE and SMI to the model and compare

Sources

  • R built-in dataset EuStockMarkets (Datastream)
  • DAT 301 lecture notes