Randomly sampling similar distributions

107 views Asked by At

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.

0

There are 0 answers