The empirical correlation matrix of daily log-returns for 423 S&P 500 constituents over January 2010 to December 2019 (2,515 trading days), after removing the leading ("market") factor.
Format
A symmetric numeric matrix with 423 rows and 423 columns. Row and column names are ticker symbols, in the same order.
Source
Derived from the "S&P500 daily update dataset", released under
CC0 1.0 (public domain dedication):
https://www.kaggle.com/datasets/yash16jr/s-and-p500-daily-update-dataset.
The derivation is scripted in data-raw/snp500.R. Note that the
upstream dataset is updated daily; this matrix is the archival record for
the fixed window above.
Details
S&P 500 returns are dominated by a market factor that loads positively on
virtually every stock and accounts for a disproportionate share of total
variance. To expose cross-sectional structure – sector and style effects –
the leading eigenvector \(v_1\) of the empirical correlation matrix
\(\Sigma\) is removed by projection,
$$P^\top \Sigma P, \qquad P = I - v_1 v_1^\top,$$
and it is this deflated matrix that is stored in snp500.
The result is symmetric positive semidefinite with rank \(p - 1 = 422\);
the zero eigenvalue is the deflated market direction.
Only the deflated correlation matrix is distributed, not the underlying returns. It is the only object the S&P 500 case study needs, and at 423 x 423 it is small enough to ship.
See also
vignette("case-study-snp500", package = "msPCA") for the
analysis built on this matrix.
Examples
data(snp500)
dim(snp500)
#> [1] 423 423
round(snp500[1:4, 1:4], 3)
#> A AAPL ABT ACGL
#> A 0.433 0.004 0.031 -0.027
#> AAPL 0.004 0.716 0.012 -0.048
#> ABT 0.031 0.012 0.614 0.010
#> ACGL -0.027 -0.048 0.010 0.631
# Rank deficient by exactly one: the market factor has been removed.
ev <- eigen(snp500, symmetric = TRUE, only.values = TRUE)$values
sum(ev > 1e-8)
#> [1] 422