Find area of overlap between two curves
问题 I've been struggling to find a solution to find the area of overlap between two curves. I'm not dealing with probability density functions with known parameters but curves obtained from smoothing of empirical data points. The only hint I found is to calculate the area that is not over-lapping as in this code (from here): x <- seq(-6,6,by = 0.01) y1 <- dnorm(x,0,1) y2 <- pnorm(x,1,1.1) f1 <- approxfun(x, y1-y2) f2 <- function(z) abs(f1(z)) dif <- integrate(f2, min(x), max(x)) plot(x,y1,type="l