I have a general function y(x) (not necessarily Gaussian). I would like to calculate percentiles of this function, preferably using np.percentile(), such that I get the x value of the percentile. For example, the x value for the 50th percentile (median). However, np.percentile() takes a distribution, not a function of some variable.
How would I compute percentiles, and various statistics (such as mean, std, median, etc.) of this function?
