0

I want to find a robust way to sample distributions that are similar to an existing distribution. This new distribution should be at least r/2 away from the original distribution, but at most r away. This should ideally work for varying values of r and size. Below I've given an example.

import numpy as np
r = 0.5
size = 50
weights = np.ones(size)/size
distr = np.random.dirichlet(weights)

I want to sample other distributions, say distr_2, that are not further than r away from distr (in terms of L1-norm), i.e.

r/2 < abs(distr - distr_2).sum() < r

Ideally, I would like to sample distr_2 as uniformly as possible from the set of distributions satisfying the above. If I just repeatedly sample distr_2 the same way I sample distr and check whether the above condition holds, I need thousands of tries (if not millions for small values of r).

Edit: Please note that distr_2 is supposed to be a probability distribution as well, i.e. it should sum to 1 and all elements should be nonnegative.

MATH101
  • 23
  • 3
  • 2
    The way the distance between *distr, distr_2* is defined depends on the (random) sample, not the distributions. Permutations of the samples will give different distances. – Michael Szczesny Sep 25 '22 at 12:42
  • 1
    Yes, that is a challenge. – MATH101 Sep 25 '22 at 13:15
  • 1
    I m not familiar to the subject but still I want to try my best to solve the problem. I understood the problem now but can you tell me what is the meaning of "new distribution should be at least r/2 away from the original distribution". Then I can continue to work on it. – Ajay Pun Magar Sep 25 '22 at 13:31
  • This is just an additional constraint on the range these newly generated distributions should differ from the original distribution, distr. Maybe, for the beginning, it is fine to try to generate probability distributions that are at most r away and ignore the lower constraint of r/2. – MATH101 Sep 25 '22 at 13:52

0 Answers0