Create samples that are the same when unordered, but have some specific correlation when ordered

31 Views Asked by At

I have 100,000 random samples (with replacement) X_i from an otherwise unknown distribution.

I want to create a series Y_i that

  1. is the same as X_i except for the ordering and
  2. gives a correlation between X and Y of some given number (or a correlation close to that given number).

Is there a known technique/procedure/algorithm for this?

1

There are 1 best solutions below

1
On BEST ANSWER

The following is a quick and dirty solution which may or may not be appropriate in your situation. In what follows $N$ is the sample size.

  1. Create a bivariate normal sample of size $N$ with the desired correlation. $(Z_1, Z_2)$
  2. Register the relative ranks (or order statistics) of $(Z_1,Z_2)$ this provides you with a bivariate Vektor of ranks $(U_1, U_2).$
  3. Register the ranks of your sample $X$.
  4. Create $Y$ by choosing from $X$ so that the ranks of $(X,Y)$ are the same as $(U_1, U_2).$

For various reasons the procedure is not (and cannot be) exact, but in many cases it should work quite well and is easy to implement.