Skip to contents

For any count vector the Gini index is at most \(\sqrt{v/2}/\bar x\), the coefficient of variation over \(\sqrt 2\) (Research.P7.Bound.gini_le_cv). Under a Poisson null the variance is the mean, so the null Gini is at most about \(1/\sqrt{2\bar x}\); the exact null distribution is simulated as well.

Usage

morie_concentration_null_bound(x, n_sim = 2000L, seed = 1L)

Arguments

x

Non-negative counts over places.

n_sim

Number of Poisson-null simulations.

seed

Seed for the simulation.

Value

A list with gini, mean, variance, cv_bound (\(\sqrt{v/2}/\bar x\), which the Gini never exceeds), null_bound (\(1/\sqrt{2\bar x}\)), null_mean, null_q95, excess (observed minus null mean) and p_value (share of null Ginis at or above the observed).

Examples

morie_concentration_null_bound(c(0, 0, 1, 2, 9, 0, 3))
#> $gini
#> [1] 0.6666667
#> 
#> $mean
#> [1] 2.142857
#> 
#> $variance
#> [1] 8.979592
#> 
#> $cv_bound
#> [1] 0.9888265
#> 
#> $null_bound
#> [1] 0.4830459
#> 
#> $null_mean
#> [1] 0.3350524
#> 
#> $null_q95
#> [1] 0.5195569
#> 
#> $excess
#> [1] 0.3316143
#> 
#> $p_value
#> [1] 0.0045
#> 
#> $n
#> [1] 7
#> 
#> $theorem
#> [1] "Research.P7.Bound.gini_le_cv"
#>