# Calculate overlap coefficient between two functions

I have two functions and I want to calculate the overlap coefficients between those two functions. A similar question has been answered for Python and R, however, I couldn't find an answer for Mathematica. Is there an inbuilt function that can do this?

http://www.r-bloggers.com/the-overlap-coefficient/

• Would that not be the difference between the integrals of those two functions, calculated on the same interval? Could you show the functions you want to work with? – MarcoB Nov 19 '15 at 12:39

Just going on the figures I see in the linked page, it seems if you are dealing with two continuous distribution functions, defined for all real numbers, then the overlap is just the minimum of the two at all points. If they are allowed to go negative, then a different definition is needed I think.

We'll look at the overlap between two Gaussians

func1[t_] := E^(-(t^2/8))/(2 Sqrt[2 \[Pi]]);
func2[t_] := E^(-2 t^2) Sqrt[2/\[Pi]];
Show[Plot[{func1[t], func2[t]}, {t, -5, 5}],
Plot[Min[{func1[t], func2[t]}], {t, -5, 5}, PlotStyle -> None,
Filling -> Axis]] Integrate[
Min[{func1[t], func2[t]}], {t, -∞, ∞}]
N @ %
(* Erf[Sqrt[(2 Log)/15]] + Erfc[4 Sqrt[(2 Log)/15]] *)
(* 0.418237 *)

Show[Plot[{func1[t - 1], func2[t]}, {t, -5, 5}],
Plot[Min[{func1[t - 1], func2[t]}], {t, -5, 5}, PlotStyle -> None,
Filling -> Axis]] Integrate[
Min[{func1[t - 1], func2[t]}], {t, -∞, ∞}]
N@ %
(* 1/2 (1 + Erf[1/15 Sqrt (-4 + Sqrt[1 + 15 Log])] +
Erf[1/15 Sqrt (4 + Sqrt[1 + 15 Log])] +
Erf[1/15 (Sqrt - 4 Sqrt[2 + 30 Log])] +
Erfc[1/15 Sqrt (1 + 4 Sqrt[1 + 15 Log])]) *)
(* 0.378459 *)


Of course it's possible I'm jumping the gun here, and don't really understand what you are looking for.

• Yep 6k! Clap, Clap – user9660 Nov 19 '15 at 13:28
• Thank you very much. There has been much procrastination of work that has led to this point :-) – Jason B. Nov 19 '15 at 13:30