Closed PhDyellow closed 2 years ago
I ended up hand-rolling a Bhattacharyya distance function that assumed Normal distributions. I don't think I was able to calculate the results much faster. The bottleneck for calculating the Bhattacharyya distance for normal distributions is inverting the joint distributions, and the base R chol2inv(chol(joint_cov))
ended up being the fastest way to invert the joint matrix. I was able to test some options for failing early but they didn't help in most cases.
fpc package and bio3d packages have existing implementations.
fpc requires us to precalculate mean and covariance matrices, which is probably a good idea for speed.
I havn't looked at bio3d yet.