Skip to content
All library documents

Calculating Rolling Cross-Sectional Rank Correlation

Article Quant Q&A · Author: user1434997

Summary

The document explains how to interpret a cross-sectional rank correlation used in a trading alpha. At each date, rank securities by each variable across the same universe, such as open price and volume, then calculate the correlation between those two cross-sectional rank vectors. This gives one rank-correlation value for that date; repeating the calculation over successive dates produces a time series of values, including a rolling window such as ten days.

The discussion identifies rank correlation with Spearman’s rho and distinguishes estimating the daily cross-sectional relationship from summarizing it over time. A simple average across dates is one possible summary, while jackknife or bootstrap methods can address estimation bias or uncertainty. If observations are dependent over time, a moving average or other time-series-aware approach may be preferable. The explanation is conceptual and does not specify implementation details such as tie handling, universe changes, or missing data.

Key ideas

  • Rank each variable across the securities in the universe at each date to form aligned cross-sectional vectors.
  • Correlating the two rank vectors at one date yields a single cross-sectional rank-correlation estimate.
  • Repeating the calculation over dates creates a time series of estimates that can be summarized over a chosen window.
  • Averaging, jackknife, bootstrap, or time-series-aware methods may be used to improve or characterize the estimate.

Tags

Full text
# Meaning of cross sectional rank


# Meaning of cross sectional rank












This paper mentions the concept of rank which is defined as cross sectional rank. For e.g. one of the alphas (#3) is

> (-1 * correlation(rank(open), rank(volume), 10))

10 is just the number of days to take any correlation over. I think we can rank the securities according to Open and Volume each day. So we will be getting different set of securities each day. I don't understand how can this daily varying set be used to get a correlation value.

I thus need guidance on now to calculate this alpha. Any help will be appreciated. Thanks

Update I understand what rank is. What I don't get is how do you calculate correlation between changing values.

> Lets say the universe is 3 stocks. On Day 1, Rank Open is 1,2,3 and Rank Volume is 3,2,1. On Day 2, Rank Open is 1,3,2 and Rank Volume is 2,3,1. On Day 3, Rank Open is 3,2,1 and Rank Volume is 1,2,3. This happens for n days (in this case 10).

My primary question is how do you calculate correlation between such vectors to arrive at a single value. Because normal correlation is between two same type of vectors.

## Answer by lehalle (score 1)

https://quant.stackexchange.com/a/78071

rank correlation is also named Spearman's rho, it is used when you do not bother with the values of series of observations $X$ and $Y$, but only of the relative orderings of observations in each of the series.

Your question is more about how to compute statistics on multidimensional time series rather than on Spreadman's rho itself:

- $X$ and $Y$ are both vectors of $\mathbb{R}^K$: $X=(X_k)_{1\leq k\leq K}$ and $Y=(Y_k)_{1\leq k\leq K}$,

- at each date $t$ you observe both of them $X(t)=(X_k(t))_{1\leq k\leq K}$.

- Your statistic (here the rank correlation) takes for any arbitrary $t$ both vectors, and returns $\hat\rho(t):=r(X(t),Y(t))$, where $r$ is your formula.

You have to consider that at each date $t$ you have only one observation of the estimate of the true Spearman's rho, and you want to have a better estimate of $\rho(X,Y)$. You can do it by several ways

- simply average over dates, when you do that you implicitly take the naive estimator the the expectation of $\rho(X,Y)$,

- you can have more information and jackknife or bootstrap $\rho(X,Y)$, with jackknife you remove a bias in the number of observations, with bootstrap you get an estimate of the variance of your estimation,

- if you do not believe that your times series $X(t)$ and $Y(t)$ are i.i.d. realisations of random variables, but rather stochastic processes (with any kind of memory), you can be smarter than that, like computing your estimator using a moving average.

## Answer by tyolab (score 0)

https://quant.stackexchange.com/a/70686

For this alpha: from any data point such Di on, we take the last ten data points (e.g. 10 days) from Di-10 to Di-1, and do the calculation with rank(D.Open)i and rank(D.Volume)i, and the result is a single value. As the data point moves, we will have an array (list) of corrections.

"Cross sectional" just means each part of the calculation using data overlapping with each other. A common name for it will be "rolling window" of a data frame.

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.