# Calculate the overlap between two stationary distributions

### Description

This function calculates a useful measure of similarity between distributions known as the *Bhattacharyya coefficient* in statistics and simply the *fidelity* or *overlap* in quantum and statistical mechanics. It is roughly speaking the ratio of the intersection area to the average individual area. When applied to `ctmm`

objects, this function returns the overlap of the two Gaussian distributions. When applied to `telemetry`

objects with corresponding movement models, this function returns the overlap of their (autocorrelated) kernel density estimates.

### Usage

1 2 3 4 5 6 7 |

### Arguments

`object1` |
A |

`object2` |
A |

`level` |
The confidence level desired for the output. |

`CTMM1` |
The |

`CTMM2` |
The |

`...` |
Additional arguments relevant for |

### Value

Confidence intervals on the overlap estimate. A value of `1`

implies that the two distributions are identical, while a value of `0`

implies that the two distributions share no area in common.

### Note

Uncertainties in `CTMM1`

and `CTMM2`

are propagated into the overlap estimate under the approximation that the Bhattacharyya distance is a chi-square random variable.

### Author(s)

C.H.Fleming

### See Also

`ctmm.fit`

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 | ```
# Load package and data
library(ctmm)
data(buffalo)
# Fit a continuous-velocity model with tau ~ c(10 days,1 hour)
# also see help(variogram.fit)
GUESS <- ctmm(tau=c(10*24*60^2,60^2))
FIT1 <- ctmm.fit(buffalo[[1]],GUESS)
FIT2 <- ctmm.fit(buffalo[[2]],GUESS)
# Gaussian overlap between these two buffalo
overlap(FIT1,FIT2)
``` |