Vectorise likelihood function to accept arrays of parameters
@ethan.payne and I are working to make some post-processing code. In order to do this quickly, we need to evaluate the likelihood function for different points in parameter space as parallel operations. Ethan looked into doing this with bilby, but he determined that it's coded in such a way that the user is forced to pass single parameter values, meaning that multiple likelihood evaluations have to go in a (very slow) for loop.
Ethan ended up writing some stand-alone code to handle the particular problem we are working on. However, I wanted to ask if it would be possible to modify bilby to allow for parallel likelihood evaluations using arrays of parameter values. I think our application is just one example of a class of problems (for example, hierarchical inference and selection effects) where this feature will be very helpful. I can imagine that there are samplers that could take advantage of this parallel structure as well.
Would this be hard to implement?