Python Forum

Full Version: how to calculate overlaping coefficient between two probablity functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have two probability density functions generated as follows:

location = 0.97
scale = 1.0
x = np.linspace(-5,5,100)

plt.subplots(figsize=(12,4))

pdf1 = skew_norm_pdf(x,location,scale,SKEW_PARAMS[0])

pdf2 = skew_norm_pdf(x, location, scale, SKEW_PARAMS[1]

How can I calculate the overlapping coefficient between the two generated probability density funtions?
In theory you can do it by finding the places where the pdfs intersect, then use the cdf. For example if pdf1(x) < pdf2(x) for all x in an interval (a, b) then you can add cdf1(b) - cdf1(a) to the overlapping coefficient.
Hi can you please explain this further, will be nice if you could add some simple scrip to do this? Moreover how do I know pdf1(x) < pdf2(x)?
How can I find the overlap between the following distributions?

from import scipy.stats

np.random.seed(seed=233423)

R1 = scipy.stats.skewnorm(2, 0, 2).rvs(1000)
R2 = scipy.stats.skewnorm(3, 1, 2).rvs(1000)
how to find the overlap between R1 and R2 in python?

These are two randomly generated distributions