Skip to main content
2 of 8
corrected first method
Aksakal
  • 62.3k
  • 6
  • 106
  • 206

I can suggest two other methods which can be better in some sense than adding noise.

shuffling noise around

Instead of adding noise, let's push it around! We'll shuffle noise between two variables so that the correlation is what we want while preserving variances of each variable. Here's the final result for S&P 500 and Apple returns in 2020 Jan-Apr, where original correlation was 94% which I changed into -70%:

enter image description here

I used PCA and Cholesky decomposition to do this:

  • apply PCA to destandardized original series X to get the uncorrelated series F
  • standardize PC factors F to get unit variance series U
  • apply Cholesky decomposition to standardized uncorrelated series U to obtain correlated series Y with unit variance
  • destandardize Y to get to the series with original means and variances X'

This looks a bit intimidating, but you don't have to do this manually, and can use software. We don't introduce external noise. We only push the noise that exists in the data already from one place to another. Total variance of the data set remains the same as well as some other characteristics such as means.

re-ordering variables

Second method is to not change the observations at all, but instead rearrange the observations in variables in such a way that correlation changes. Consider this: if I take random samples from both series, and calculate the correlation between these samples, then correlation will be zero. So, simple rearranging the order in variables will change correlation.

Advantage of this method is that variances remain the same, and overall distributions remain intact in the dataset. Since, you work with stock return, there's no autocorrelation, so rearranging doesn't impact this aspect at all, at least in theory

Aksakal
  • 62.3k
  • 6
  • 106
  • 206