# HDutility: Hellinger Distance (Utility) In SmallCountRounding: Small Count Rounding of Tabular Data

## Description

Hellinger distance (`HD`) and a related utility measure (`HDutility`) described in the reference below. The utility measure is made to be bounded between 0 and 1.

## Usage

 ```1 2 3``` ```HD(f, g) HDutility(f, g) ```

## Arguments

 `f` Vector of original counts `g` Vector of perturbed counts

## Details

HD is defined as "`sqrt(sum((sqrt(f) - sqrt(g))^2)/2)`" and HDutility is defined as "`1 - HD(f, g)/sqrt(sum(f))`".

## Value

Hellinger distance or related utility measure

## References

Shlomo, N., Antal, L., & Elliot, M. (2015). Measuring Disclosure Risk and Data Utility for Flexible Table Generators, Journal of Official Statistics, 31(2), 305-324. doi: https://doi.org/10.1515/jos-2015-0019

## Examples

 ```1 2 3 4 5 6 7 8 9``` ```f <- 1:6 g <- c(0, 3, 3, 3, 6, 6) print(c( HD = HD(f, g), HDutility = HDutility(f, g), maxdiff = max(abs(g - f)), meanAbsDiff = mean(abs(g - f)), rootMeanSquare = sqrt(mean((g - f)^2)) )) ```

SmallCountRounding documentation built on Oct. 30, 2019, 11:23 a.m.