I have 100,000 random samples (with replacement) X_i from an otherwise unknown distribution.
I want to create a series Y_i that
- is the same as X_i except for the ordering and
- 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?
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.
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.