hdistpara: Parametric estimation of the Hellinger distance between two...

Description Usage Arguments Details Value Author(s)

View source: R/hdistpara.R

Description

Parametric estimation of the Hellinger distance between two random variates

Usage

1
hdistpara(x1, x2 = NULL, params = NULL, densfun = 'normal')

Arguments

x1

A numeric random variate of draws from the first distribution

x2

An optional numeric random variate of draws from the second distribution.

params

An optional numeric of two parameters giving the parameters for the density function.

densfun

A character giving the density function to fit to both variates. Currently only "normal" and "beta" are supported.

Details

Hellinger distance is approximated by fitting distributions using MASS::fitdistr and then calculating the exact Hellinger distance given the fitted parameters. Currently the only options are to compare two Beta distributions or two normal distributions (the default).

If params is given the second density function will be specified exactly. If x2 is given, the second density function will be estimate from the random variate. If using params the parameters should be the mean and sd (ie c(mean, sd)) in that order for 'normal' density and a and b for the beta distribution (ie c(a, b)) in that order. ' Class helldistp has a plot method that can be used to compared the discrete and continuous distribution fits. It is recommended to visually check distribution fits, particularly if the number of random variates is small.

In general these methods will be inaccurate if analysis is performed on too few samples, e.g. <10 000. >100 000 would be ideal.

Value

A helldistp object containing approximate Hellinger distances and fitted density kernals. hdistEstimate of Hellinger distance

Author(s)

Christopher J. Brown christo.j.brown@gmail.com


cbrown5/BayeSens documentation built on April 26, 2020, 12:40 a.m.