pyabc.random_choice

Random choice

Fast random choice from a list of weights.

pyabc.random_choice.fast_random_choice(weights)[source]

This is at least for small arrays much faster than numpy.random.choice. For the Gillespie, overall this brings for 3 reactions a speedup factor of 2.