Functions
Inequality.atkinsonInequality.fgtInequality.gen_entropyInequality.giniInequality.headcountInequality.lorenz_curveInequality.mldInequality.poverty_gapInequality.theilInequality.watts
Inequality.atkinson — Functionatkinson(v, ϵ)Compute the Atkinson Index of a vector v at a specified inequality aversion parameter ϵ.
Examples
julia> using Inequality
julia> atkinson([8, 5, 1, 3, 5, 6, 7, 6, 3], 1.2)
0.1631765870035865atkinson(v, w, ϵ)Compute the weighted Atkinson Index of a vector v at a specified inequality aversion parameter ϵ, using weights given by a weight vector w.
Weights must not be negative, missing or NaN. The weights and data vectors must have the same length.
Examples
julia> using Inequality
julia> atkinson([8, 5, 1, 3], [0.1,0.5,0.3,0.8], 1.2)
0.1681319821792493Inequality.gini — Functiongini(v)Compute the Gini Coefficient of a vector v .
Examples
julia> using Inequality
julia> gini([8, 5, 1, 3, 5, 6, 7, 6, 3])
0.2373737373737374gini(v, w)Compute the weighted Gini Coefficient of a vector v using weights given by a weight vector w.
Weights must not be negative, missing or NaN. The weights and data vectors must have the same length.
Examples
julia> using Inequality
julia> gini([8, 5, 1, 3, 5, 6, 7, 6, 3], collect(0.1:0.1:0.9))
0.20652395514780775Inequality.lorenz_curve — Functionlorenz(v)
Compute the relative Lorenz Curve of a vector v .
Returns two vectors. The first one contains the cumulative proportion of people. The second contains the cumulative share of income earned.
Examples
julia> using Inequality
julia> lorenz_curve([8, 5, 1, 3, 5, 6, 7, 6, 3])
([0.0, 0.1111111111111111, 0.2222222222222222, 0.3333333333333333, 0.4444444444444444, 0.5555555555555556, 0.6666666666666666, 0.7777777777777778, 0.8888888888888888, 1.0],
│ [0.0, 0.022727272727272728, 0.09090909090909091, 0.1590909090909091, 0.2727272727272727, 0.38636363636363635, 0.5227272727272727, 0.6590909090909091, 0.8181818181818182, 1.0])lorenz(v, w) Compute the weighted Lorenz Curve of a vector v using weights given by a weight vector w.
Weights must not be negative, missing or NaN. The weights and data vectors must have the same length.
Returns two vectors. The first one contains the cumulative proportion of weighted people. The second contains the cumulative share of income earned.
Examples
julia> using Inequality
julia> lorenz_curve([8, 5, 1, 3, 5, 6, 7, 6, 3], collect(0.1:0.1:0.9))
([0.0, 0.06666666666666667, 0.08888888888888889, 0.13333333333333333, 0.2222222222222222, 0.3333333333333333, 0.5333333333333333, 0.6666666666666666, 0.8444444444444444, 1.0],
[0.0, 0.013761467889908256, 0.05045871559633028, 0.0963302752293578, 0.1513761467889908, 0.2660550458715596, 0.38990825688073394, 0.555045871559633, 0.7752293577981653, 1.0])Inequality.mld — Functionmld(v)Compute the Mean log deviation of a vector v.
Examples
julia> using Inequality
julia> mld([8, 5, 1, 3, 5, 6, 7, 6, 3])
0.1397460530936332mld(v, w)Compute the weighted Mean log deviation of a vector v using weights given by a weight vector w.
Weights must not be negative, missing or NaN. The weights and data vectors must have the same length.
Examples
julia> using Inequality
julia> mld([8, 5, 1, 3, 5, 6, 7, 6, 3], collect(0.1:0.1:0.9))
0.10375545537468206Inequality.gen_entropy — Functiongen_entropy(v, α)
Compute the Generalized Entropy Index of a vector `v` at a specified parameter `α`.Examples
julia> using Inequality
julia> gen_entropy([8, 5, 1, 3, 5, 6, 7, 6, 3], 2)
0.09039256198347094gen_entropy(v, w, α)Compute the Generalized Entropy Index of a vector v, using weights given by a weight vector w at a specified parameter α.
Weights must not be negative, missing or NaN. The weights and data vectors must have the same length.
Examples
julia> using Inequality
julia> gen_entropy([8, 5, 1, 3, 5, 6, 7, 6, 3], collect(0.1:0.1:0.9), 2)
0.0709746654322026Inequality.watts — Functionwatts(v, k)
Compute the Watts Poverty Index of a vector `v` at a specified absolute
poverty line `k`.Examples
julia> using Inequality
julia> watts([8, 5, 1, 3, 5, 6, 7, 6, 3], 4)
0.217962056224828watts(v, w, α)Compute the Watts Poverty Index of a vector v at a specified absolute poverty line α, using weights given by a weight vector w.
Weights must not be negative, missing or NaN. The weights and data vectors must have the same length.
Examples
julia> using Inequality
julia> watts([8, 5, 1, 3, 5, 6, 7, 6, 3], collect(0.1:0.1:0.9), 4)
0.17552777833850716Inequality.theil — Functiontheil(v)
Compute the Theil Index of a vector `v`.Examples
julia> using Inequality
julia> theil([8, 5, 1, 3, 5, 6, 7, 6, 3])
0.10494562214323544theil(v, w)Compute the Theil Index of a vector v, using weights given by a weight vector w.
Weights must not be negative, missing or NaN. The weights and data vectors must have the same length.
Examples
julia> using Inequality
julia> theil([8, 5, 1, 3, 5, 6, 7, 6, 3], collect(0.1:0.1:0.9))
0.08120013911680612Inequality.fgt — Functionfgt(v, α, z)Compute the Foster–Greer–Thorbecke Index of a vector v at a specified α and a given poverty threshold z.
Examples
julia> using Inequality
julia> fgt([8, 5, 1, 3, 5, 6, 7, 6, 3], 2, 4)
0.0763888888888889fgt(v, w, α, z)Compute the Foster–Greer–Thorbecke Index of a vector v at a specified α and a given poverty threshold z, using weights given by a weight vector w.
Weights must not be negative, missing or NaN. The weights and data vectors must have the same length.
Examples
julia> using Inequality
julia> fgt([8, 5, 1, 3, 5, 6, 7, 6, 3], collect(0.1:0.1:0.9), 2, 4)
0.05555555555555555Inequality.headcount — Functionheadcount(v, z)Compute the Headcount Ratio of a vector v at a specified poverty threshold z.
Examples
julia> using Inequality
julia> headcount([8, 5, 1, 3, 5, 6, 7, 6, 3], 4)
0.3333333333333333headcount(v, w, z)Compute the Headcount Ratio of a vector v at a specified poverty threshold z, using weights given by a weight vector w.
Weights must not be negative, missing or NaN. The weights and data vectors must have the same length.
Examples
julia> using Inequality
julia> headcount([8, 5, 1, 3, 5, 6, 7, 6, 3], [0.1,0.5,0.3,0.8,0.1,0.5,0.3,0.8,0.2], 4)
0.36111111111111116Inequality.poverty_gap — Functionpoverty_gap(v, z)Compute the Poverty Gap of a vector v at a specified poverty threshold z.
Examples
julia> using Inequality
julia> poverty_gap([8, 5, 1, 3, 5, 6, 7, 6, 3], 4)
0.1388888888888889poverty_gap(v, w, z)Compute the Poverty Gap of a vector v at a specified poverty threshold z, using weights given by a weight vector w.
Weights must not be negative, missing or NaN. The weights and data vectors must have the same length.
Examples
julia> using Inequality
julia> poverty_gap([8, 5, 1, 3, 5, 6, 7, 6, 3], [0.1,0.5,0.3,0.8,0.1,0.5,0.3,0.8,0.2], 4)
0.13194444444444445