# `Spatex.ESDA.G`
[🔗](https://github.com/CountlinkX-Solutions/spatex/blob/v0.2.1/lib/spatex/esda/g.ex#L1)

Result of `Spatex.ESDA.getis_ord_g/3`: the Getis-Ord general G with analytic and permutation
inference. Field names are PySAL's `esda.G` attributes in snake_case (`seG_sim` is
`se_g_sim`); `den_sum` is `(sum y)^2 - sum y^2`.

With `keep_simulations: :tensor`, `sim` is an `Nx.Tensor` of type `{:f, 64}` and shape
`{permutations}` instead of a list.

`z_norm` and `p_norm` are `:nan` when the variance `vg` is not positive (a complete graph).
Simulation fields (`sim`, `p_sim`, `eg_sim`, `se_g_sim`, `vg_sim`, `z_sim`, `p_z_sim`,
`seed`) are `nil` when `permutations: 0`; `sim` is also `nil` with `keep_simulations: false`.
Non-finite values are the atoms `:nan`, `:infinity` and `:neg_infinity`.

# `t`

```elixir
@type t() :: %Spatex.ESDA.G{
  den_sum: value(),
  eg: value(),
  eg_sim: value() | nil,
  g: value(),
  n: pos_integer(),
  p_norm: value(),
  p_sim: float() | nil,
  p_z_sim: value() | nil,
  permutations: non_neg_integer(),
  se_g: value(),
  se_g_sim: value() | nil,
  seed: non_neg_integer() | nil,
  sim: [float()] | Nx.Tensor.t() | nil,
  vg: value(),
  vg_sim: value() | nil,
  z_norm: value(),
  z_sim: value() | nil
}
```

# `value`

```elixir
@type value() :: float() | :nan | :infinity | :neg_infinity
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
