Result of Spatex.Inequality.spatial_gini/3 (inequality.gini.Gini_Spatial).
g- Gini coefficient;dtotal- the sum of absolute differences over all ordered pairs (g * den,den = 2 n^2 mean).wg- the part ofdtotalbetween neighbors,wcg = dtotal - wgbetween non-neighbors,wcg_share = wcg / den.polarization-(wcg / wg) (neighbor pairs / non-neighbor pairs), expected 1 when inequality is spatially random.- With permutations:
p_sim(folded pseudo p-value ofwcg),e_wcg,s_wcg,z_wcg,p_z_sim = 1 - Phi(z_wcg),polarization_p_sim, and (withkeep_simulations: true) the simulated valueswcgpandpolarization_sim. Allnilotherwise. Withkeep_simulations: :tensorthe two simulated vectors are{permutations}Nx.Tensors of type{:f, 64}instead of lists.
Summary
Types
@type t() :: %Spatex.Inequality.SpatialGini{ den: value(), dtotal: value(), e_wcg: value() | nil, g: value(), p_sim: value() | nil, p_z_sim: value() | nil, permutations: non_neg_integer(), polarization: value(), polarization_p_sim: value() | nil, polarization_sim: [value()] | Nx.Tensor.t() | nil, s_wcg: value() | nil, seed: non_neg_integer() | nil, wcg: value(), wcg_share: value(), wcgp: [float()] | Nx.Tensor.t() | nil, wg: value(), z_wcg: value() | nil }
@type value() :: float() | :nan | :infinity | :neg_infinity