Asset analysis: methodology from correlation to cointegration
The Assets page analyses the securities in the grid statistically: how are they related, how many independent sources of risk do they contain, do their returns follow a pattern, and do two prices move together over the long run? This asset analysis methodology describes each calculation together with the tests the code uses.
Data and frequency
The basis is the prices of all tickers in the grid in the base currency from the settings, aligned to their common period. The data frequency follows the settings (daily or monthly); if asset classes are included, the page always calculates monthly, because they only have monthly values. Returns are simple period returns. The overview and calendar years use the same metrics as the backtest (metrics methodology), and portfolios are reset to their weights at every month end (without costs).
Correlation
The correlation matrix is the Pearson correlation of returns over the common period. The rolling correlation of two series uses a moving window, by default 36 months or 252 trading days, selectable from 6 to 2,520 periods. Rolling values show how unstable correlations are: Longin and Solnik (2001) found that correlations between international equity markets rise in bear markets. Diversification then helps less than the average suggests (see Correlation and diversification).
Principal components (PCA)
Principal component analysis, following Pearson (1901), decomposes the common variation into uncorrelated components. By default, Portfolio Lab standardizes the returns (correlation matrix) so that volatile assets do not determine the first component on their own; optionally, it calculates with the covariance matrix. Series without any variation are dropped; more observations than series plus two are required.
- Explained variance per component = eigenvalue / sum of eigenvalues. The sign of each component is chosen so that the sum of its loadings is positive. PC1 is then usually “the market”.
- Effective number of independent risk sources = exp(−Σ p_i · ln p_i) with the explained shares p_i: 1 for a single source, n for n equally strong ones.
- Absorption ratio: share of the variance in the first ⌈n/5⌉ components, following Kritzman et al. (2011). It rises when a few forces dominate the market. With five series or fewer, the page shows the share of PC1 and PC2 instead.
- Rolling PC1 share: the same calculation over 36 months or 252 trading days (with daily data, one point every 21 days).
Autocorrelation and variance ratio
For a series or a portfolio, the page shows the autocorrelation (ACF) and the partial autocorrelation (PACF, Durbin-Levinson recursion) for 4 to 60 lags (default 24 months or 20 days). The band ± 1.96 / √n marks the range within which values would lie in 95% of cases under pure randomness. Optionally, the page calculates with squared deviations from the mean. These reveal volatility clustering, even when the returns themselves are uncorrelated.
Q(h) = n · (n + 2) · Σ_{k=1..h} ρ_k² / (n − k)- Q(h)
- Ljung-Box statistic up to lag h, χ²-distributed with h degrees of freedom
- ρ_k
- autocorrelation at lag k
The test following Ljung and Box (1978) is shown for horizons 1, 3, 6, 12 and 24. The variance ratio following Lo and MacKinlay (1988) compares the variance of (overlapping) q-period returns with q times the one-period variance: a value above 1 points to trends, below 1 to mean reversion. The z-statistic is robust to changing volatility. Horizons: 2, 3, 6 and 12 months or 2, 5, 21 and 63 days.
Cointegration
Two prices are cointegrated if each wanders on its own but a linear combination of them returns to an equilibrium (Engle and Granger 1987). Portfolio Lab tests following Engle and Granger, using log prices (optionally the prices themselves):
- Regression log Y = a + b · log X + u over the common period (at least 30 observations).
- Augmented Dickey-Fuller test following Dickey and Fuller (1979) on the spread u (without a constant); the number of lags is chosen by the Akaike criterion up to 12 · (n/100)^¼. A textbook treatment of unit roots and cointegration is given by Hamilton (1994).
- Comparison with the critical values of MacKinnon (2010) for two variables; shown as a band (p < 1%, < 5%, < 10% or ≥ 10%).
- Half-life of mean reversion: from Δu_t = λ · u_{t−1} + c, it follows that the half-life is −ln 2 / ln(1 + λ) periods.
With three or more series, the page shows the test statistic for all ordered pairs. Each cell is a separate test; with many pairs, some will appear “cointegrated” purely by chance. The page therefore states the number of hits and the number of tests. The ADF test for each series checks beforehand whether the prices themselves are non-stationary, as the method requires.
Fund comparison as of a common reference date
Unlike the backtest, the fund comparison does not truncate to the common start: each fund keeps its own history, but all are brought to the same reference date (the last completed month that all of them have). Series that end more than two months before the most recent one (closed funds, data gaps) are dropped and listed, so that they do not pull the reference date back for everyone.
- Trailing returns over 1, 3 and 6 months, year to date and 1, 3, 5, 10 and 15 years (annualized from three years), each only if the period is covered without gaps.
- Risk (volatility, Sharpe, Sortino, drawdown) and, with a benchmark, beta, alpha, R², tracking error, information ratio and capture ratios in a window of 12, 36, 60 or 120 months up to the reference date, only with full coverage.
- Rank per metric (1 = best) and, from four funds, the quartile: percentile rank (rank − 1) / (n − 1), quartile 1 up to 25%, 2 up to 50%, 3 up to 75%.
- Rolling returns over 12, 36 or 60 months (annualized from 12 months) and the relative performance against the benchmark.
Frequently asked questions
Why does the PCA standardize the returns?
Otherwise the asset with the highest volatility almost single-handedly determines the first component. With standardized returns, the PCA measures how similarly the assets move, regardless of how much they fluctuate.
What does a variance ratio of 1.3 after twelve months tell you?
The variance of annual returns is 30% higher than twelve independent months would suggest. That points to trends. Whether this is due to chance is shown by the p-value of the robust z-statistic.
Does cointegration mean that pairs trading works?
Not necessarily. The test looks backwards, equilibria break down, and when many pairs are tested, some hits are due to chance. Costs and short selling are not taken into account.
Why is the 5-year return missing for a fund?
Because the fund does not cover the period up to the reference date without gaps: it is younger, or months are missing. Better a gap than a return calculated from too few months.
Literature
- Dickey, David A.; Fuller, Wayne A. (1979): Distribution of the Estimators for Autoregressive Time Series with a Unit Root. Journal of the American Statistical Association 74 (366a), pp. 427–431. doi:10.1080/01621459.1979.10482531
- Engle, Robert F.; Granger, C. W. J. (1987): Co-Integration and Error Correction: Representation, Estimation, and Testing. Econometrica 55 (2), pp. 251–276. doi:10.2307/1913236
- Hamilton, James D. (1994): Time Series Analysis. Princeton University Press.
- Kritzman, Mark; Li, Yuanzhen; Page, Sébastien; Rigobon, Roberto (2011): Principal Components as a Measure of Systemic Risk. The Journal of Portfolio Management 37 (4), pp. 112–126. doi:10.3905/jpm.2011.37.4.112
- Ljung, G. M.; Box, G. E. P. (1978): On a measure of lack of fit in time series models. Biometrika 65 (2), pp. 297–303. doi:10.1093/biomet/65.2.297
- Lo, Andrew W.; MacKinlay, A. Craig (1988): Stock Market Prices Do Not Follow Random Walks: Evidence from a Simple Specification Test. Review of Financial Studies 1 (1), pp. 41–66. doi:10.1093/rfs/1.1.41
- Longin, François; Solnik, Bruno (2001): Extreme Correlation of International Equity Markets. The Journal of Finance 56 (2), pp. 649–676. doi:10.1111/0022-1082.00340
- Pearson, Karl (1901): On lines and planes of closest fit to systems of points in space. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science 2 (11), pp. 559–572. doi:10.1080/14786440109462720
This page describes how Portfolio Lab calculates; past results are not a forecast. All terms in the glossary.