Description Usage Arguments Details Value Author(s)
View source: R/remix_hellinger.R
Estimate the Hellinger distance between priors and posteriors
1 | remix_hellinger(simmr_out, prior.control, plot.dens = TRUE)
|
simmr_out |
A |
prior.control |
A |
plot.dens |
A |
Hellinger distance is a metric of the distance between two distributions (densities). Values of 0 indicate the distributions are identical. A value of 1 indicates that one distribution takes a value of zero everywhere that the other distribution takes a positive value.
For isotope mixing models, values approaching 1 indicate the prior has decreasing influence on the posterior. In general
Hellinger distance is approximated in two ways:
(1) by binning the random variates and calculating the Hellinger distance for discrete distributions and
(2) by creating a continuous approximation of the distributions using
density
and then using numerical integration to calculate the
Hellinger distance.
Method (2) - continuous integration - should in genernal be more accurate however, it may give poor approximations for multi-modal distributions.
Continuous integration may return NaN if the distributions are near identical.
In cases of large discrepencies, the discrete metric is recommended. Large discrepencies probably indicate multi-modal distributions.
It is recommended to visually
check distribution fits, particularly if the number of random variates is
small.
See hellinger
from package BayeSens
for more details on Hellinger distance.
See plot_dists
if you want to plot the densities too.
In general these methods will be inaccurate if analysis is performed on too few samples, e.g. <10 000. >100 000 would be ideal.
A data.frame
containing the Hellinger distances between
each source's prior and posterior distributions.
Christopher J. Brown christo.j.brown@gmail.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.