# Transforming a distribution into another one?

Say I have two vectors X1 and X2, and they form two distributions.

Is there any way to transform X1 so after the transformation the new_X1 will have a similar distribution with X2?

As we can transform some distribution into normal ones, I am curious if we can transform a distribution into an arbitrary one?

• It is better to say that you have two random variables $X_{1}$ and $X_{2}$ that are distributed as desired. The vectors can themselves be distributed as these random variables or can be a sample from these random variables. There are many examples of transforming a random variable into another. – Ed P May 21 '19 at 6:55
• The probability integral transform (PIT) will convert each distribution into a uniform one, so apply the PIT to one vector and the inverse of the PIT (relative to the other vector) will do the trick. For application to data (empirical distributions, aka "vectors") see stats.stackexchange.com/questions/36001/… for details. – whuber May 21 '19 at 12:22

As pointed out in the comment, the question makes more sense if we consider converting random variables. As for your statement about transforming into normal distribution, I hope you're referring to something like Box-Cox (which is an approximate method), not feature normalization with $$(x-\mu)/\sigma$$, since it's not transforming to normal distribution.
A standard way for converting a RV from some distribution into another is using Inverse CDF method. Typically, many random number generators use this method to convert the uniform distribution into an arbitrary one. Sometimes, this might not be enough since we can't get analytical inverse of $$F(x)$$, as in normal RV, and other methods exist, e.g. Box-Muller for uniform(s) to normal(s) conversion. When the transform accepts going in reverse direction, we can first convert $$X_1$$ to $$U$$, then $$U$$ to $$X_2$$.