Skip to content
All library documents

Hierarchical PCA for Grouped Financial Predictors

Article Quant Q&A · Author: ds_col

Summary

The document outlines an implementation question about hierarchical principal component analysis for financial predictors divided into five groups. It contrasts a standard PCA on the full training matrix with a two-stage idea drawn from a portfolio-management paper: estimate correlations within predictor blocks, then model correlations between blocks using the leading factors extracted from those blocks. A second PCA would then be applied to the adjusted correlation or covariance matrix.

The text does not provide a working implementation or comparative results. It raises practical questions about constructing the adjusted matrix, handling scaling when PCA receives a matrix of correlations, and whether generic routines can efficiently estimate intra- and inter-block relationships. These are important implementation details: the suggested procedure depends on how factors and cross-block correlations are defined, and the document does not settle those choices. It is therefore a conceptual outline and request for guidance rather than evidence that hierarchical PCA outperforms standard PCA.

Key ideas

  • The proposed workflow groups predictors before estimating principal components.
  • Within-block correlations are estimated from predictors in the same group.
  • Cross-block relationships are represented through correlations between leading group factors.
  • A subsequent PCA is intended to use the adjusted correlation or covariance matrix.
  • The document leaves matrix construction, scaling choices, and empirical comparison unresolved.

Tags

Full text
# Implementing Hierarchical PCA for financial time series in R


# Implementing Hierarchical PCA for financial time series in R












I would like to implement the method "Hierarchical PCA", as described in the following paper and compare it to a "standard" PCA. I like to do this in R

AVELLANEDA, Marco. Hierarchical pca and applications to portfolio management. Revista mexicana de economía y finanzas, 2020, 15. Jg., Nr. 1, S. 1-16.

My "standard" PCA is based on a T x n predictor matrix `Predictors_train`. Each of the predictors belongs to one of 5 "groups". I would use the following code:

```
pca_pred <- Predictors_train %>%
            prcomp(scale. = TRUE, center=TRUE)
```

Now, implementing the method it seems I have to

- reestimate/adjust the correlation matrix

- estimate a new PCA based on the adjusted covariance matrix.

As for 2), it seems to be clear that I have to use `prcomp()` on the adjusted correlation matrix, e.g. in the following form

```
pca_pred <- AdjustedMatrix %>%
            prcomp(scale. = TRUE, center=TRUE)
```

(Maybe I will not need the scaling, as I use a matrix as an input this time and not time series.

As for 1), the method in the paper suggests that I would a) calculate the standard correlation matrix b) use the results within the "blocks" of the predictors c) for elements of different blocks, use the simplified estimate beta_ibeta_jcorr(F_k(i), F_k(j)) , where the F_k()s are the first factors of PCA components within the blocks.

My approach would be to write all the low-level code myself (using some loops). But maybe there is an easier way to do this? In a sense, it seems to be a standard operation, but I cannot figure out the "generic" aspect that would help me to calculate the intra- and inter-block correlation efficiently.

Has anyone experienced similar problems?

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.