I want to find the area of overlap between two distributions in MATLAB. I found a solution in Python (Calculate overlap area of two functions) but am unfortunately stuck using MATLAB for this problem.
Here is an example of two simple normal distributions (y1, y2). I'd like to calculate the area of overlap between these distributions.
x = linspace(-15, 15);
y1 = normpdf(x, -5, 2.7)*5000;
y2 = normpdf(x, +5, 2.9)*5500;
% PLOT
plot(x, y1)
hold on
plot(x, y2)