# `Spatex.Regression.SURerrorML`
[🔗](https://github.com/CountlinkX-Solutions/spatex/blob/v0.2.1/lib/spatex/regression/sur_error_ml.ex#L1)

Result of `Spatex.Regression.sur_error_ml/4` (`spreg.SURerrorML`): seemingly unrelated
regressions with a spatial error process in every equation, estimated by maximum likelihood.

Per-equation fields are lists with one entry per equation, in order.

  * `n`, `n_eq`, `k` - observations, equations and, per equation, the number of coefficients.
  * `lam` - the ML spatial error parameter of every equation (spreg's `lamsur`); `lam_ols` -
    the equation-by-equation ML error estimates (`lamols`) that start the search.
  * `b_sur0`, `llik` - the coefficients and log-likelihood (constant included) of the classic
    iterated SUR (`spreg.SUR` with `iter: true`) that provides the starting residuals.
  * `b_sur` - the ML SUR coefficients on the spatially filtered variables (the constant first,
    `"Constant_<eq>"`); `varb` - covariance of all coefficients stacked; `sur_inf` - per
    equation, one `{std_err, z, p}` per coefficient.
  * `sig`, `corr` - the cross-equation covariance of the filtered residuals and its correlation.
  * `clik_err`, `clik_sur_err` - concentrated log-likelihoods (no constant) of the equation by
    equation ML error models and of the ML SUR error model; `llik_err`, `llik_sur_err` - the same
    with the constant `-n/2 (n_eq (1 + ln 2 pi))` added.
  * `lr_test` - `{stat, df, p}` likelihood-ratio test of a diagonal `sig` (`nonspat_diag: true`,
    the default); `lr_lambda` - `{stat, df, p}` likelihood-ratio test of the spatial error
    parameters against the classic SUR (`spat_diag: true`); `nil` otherwise.
  * `vm` - asymptotic covariance of the lambdas and the upper-triangular elements of `sig`
    (`n_eq + n_eq (n_eq + 1) / 2` square, `vm: true`); `lam_setp` - per equation
    `{std_err, z, p}` of lambda; `lam_test` - `{stat, df, p}` Wald test that the lambdas are equal
    across equations; `join_lam` - Wald test that they are jointly zero (needs `vm: true` and
    `spat_diag: true`). `nil` when not requested.
  * `chow` - with the same number of coefficients in every equation, one `{stat, df, p}` Wald
    test per coefficient of its equality across equations; `nil` otherwise.
  * `residuals`, `predicted` - one list of `n` values per equation (`y - X b`, on the original,
    unfiltered variables).
  * `iterations` - the number of lambda searches of the estimation loop; `converged` - whether
    the loop stopped on its tolerance before the 2000 round cap.
  * `name_y`, `name_x` - names, per equation (`name_x` starts with `"Constant_<eq>"`).
  * `warnings`.

# `t`

```elixir
@type t() :: %Spatex.Regression.SURerrorML{
  b_sur: term(),
  b_sur0: term(),
  chow: term(),
  clik_err: term(),
  clik_sur_err: term(),
  converged: term(),
  corr: term(),
  iterations: term(),
  join_lam: term(),
  k: term(),
  lam: term(),
  lam_ols: term(),
  lam_setp: term(),
  lam_test: term(),
  llik: term(),
  llik_err: term(),
  llik_sur_err: term(),
  lr_lambda: term(),
  lr_test: term(),
  n: term(),
  n_eq: term(),
  name_x: term(),
  name_y: term(),
  predicted: term(),
  residuals: term(),
  sig: term(),
  sur_inf: term(),
  varb: term(),
  vm: term(),
  warnings: term()
}
```

---

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