# Change distribution of a vector

I have the following vector my_vector=[0.059; 0.223;0.197;0.176; 0.173; 0.171; 0.0421; 0.209; 0.556;0.252;0.198; 0.255; 0.130; 0.176; 0.110; 0.0845; 0.270; 0.192; 0.199; 0.348]

I want to change the vector in such a way that the output derived vector will have the highest possible distribution change. This means the distribution of the two vectors should be highly different (say have large KLD values) but their distribution should be still from the same family (say the F-test or two-sample K–S test will not reject the hypothesis that they are from the same distribution).

How could I generate the new vector from the base vector while I meet the constraint (having "highest" "possible" change in distribution)? I need a machine learning (data-driven) method to achieve such a goal.

Thanks in advance for any help and recommendation.

• Well, I think you would not think to start from your vector then. Just create a new vector with length similar to yours randomly sampled from the distribution of your interest and compute KLD, and repeat the process till KLD is maximized! To me this seams as a plausible method to start. I do not know if there is any off-the-shelf ML model to do this for you. Still the method would data-driven so to say. For the implementation, you can borrow most of materials from this post: towardsdatascience.com/… Apr 3, 2020 at 15:02
• Thank you very much, TwinPenguins. I appreciate your comment. So, based on your proposed solution, I have to iterate it and every time calculate KLD of the new vector and also check the K-S test between two samples. However, I need a more systematic method since I will do it over and over. I mean from the newly generated vector, I should generate another one which will have the same mentioned situation. Apr 3, 2020 at 16:46

I think the answer(comment) of TwinPenguins provides you a good start. You could improve this by using a Metropolis Monte Carlo approach instead of just trying again and again generating new vectors. What you could do is:

1. create a new vector with length similar to yours randomly sampled from the distribution of your interest and compute KLD$$_{old}$$ (cf. TwinPenguins)
2. modify this vector and compute KLD$$_{new}$$.
3. if (KLD$$_{new}$$ is better than KLD$$_{old}$$), the new vector becomes your old vector