identify the point of intersection from two distributions Dear StackExchange community,
I have a problem of identifying where two distributions $F$ and $G$ intersect (cross each other). In particular, I have an empirical estimation of $F$ and $G$ from the data I have and I'm looking for a point above which $G$ is likely true over $F$. In other words, $F$ is a reference distribution and $G$ is the target. Therefore, we would like to know if an item with value $x$ is positive (which means that $x$ has a higher probability under $G$ than in $F$). The problem is that the empirical estimations of $F$ and $G$ result in multi-modal distribution, and hence it has been a difficult task for me to obtain one most plausible intersection point. Please also see the attached image for an example (a simple scenario). Note that the empirical estimation was obtained using kernel density estimation (density() of R). se let me know if there is a method I can try to obtain the intersection point.
Thanks in advance.

Here is a crude approach to find the intersection point(s).
# Generate data
  set.seed(12345)
  x <- rnorm(100)
  y <- rnorm(150, 1, 3)

# Find global minimum and maximum
  xymin <- min(x,y)
  xymax <- max(x,y)
# Estimate densities
  dx <- density(x, n=512, from=xymin, to=xymax)
  dy <- density(y, n=512, from=xymin, to=xymax)

# Plot results
  plot(dx, xlim=c(xymin, xymax), type="l", lwd=3, xlab="X", ylab="Density", main="")
  lines(dy, col="red", lwd=3)

# Differences in densities
  dx$diff <- dx$y - dy$y
  ex <- NULL  # Store the interection points
  ey <- NULL
  k = 0
  for (i in 2:length(dx$x)) {
      # Look for a change in sign of the difference in densities
      if (sign(dx$diff[i-1]) != sign(dx$diff[i])) {
         k = k + 1
         # Linearly interpolate
         ex[k] <- dx$x[i-1] + (dx$x[i]-dx$x[i-1])*(0-dx$diff[i-1])/(dx$diff[i]-dx$diff[i-1])
         ey[k] <- dx$y[i-1] + (dx$y[i]-dx$y[i-1])*(ex[k]-dx$x[i-1])/(dx$x[i]-dx$x[i-1])
         lines(c(ex[k],ex[k]), c(0,ey[k]))
         points(ex[k], ey[k], pch=16, col="green" )
    }
  }


  cbind(ex, ey)

#            ex         ey
#[1,] -1.957378 0.06736659
#[2,]  2.106521 0.12664663

