# Definite Numerical Integration with Unknown limit

How to solve for small gamma in the integral equation in Scipy ? I recognize it has to be solved with both the numerical integral and a root solver (Newton's method)

$$\int_{\gamma}^{+\infty}f(x) dx = 0.01$$

The function f isn't a known analytical function, it is a probability distribution represented by an array of samples of a histogram.

So essentially the integral is :

$$\sum_{k = \gamma}^{+\infty} f[k] \Delta x \approx 0.01$$

• This is called "quantile estimation". Aug 10 at 17:45

You might simply sort the data in ascending order, then figure out which value corresponds to the upper 99th percentile. If $$y[0], \dots, y[N-1]$$ is your sorted data, it'll be $$y[I]$$ where $$I = 0.99 \times N$$. This is a simple quantile estimation as mentioned in the comments by Mark Stone.