nispace.stats.coloc.beta

nispace.stats.coloc.beta(x, y, intercept=True)[source]

Beta coefficients for the regression of predictor(s) x on target y (see mlr).

Same fitting procedure as mlr but returns only the coefficients, without the R2.

Parameters:
  • x (np.ndarray, shape (n_obs, n_predictors), dtype float) – Numba-jitted: must be a plain 2D np.ndarray. Does not handle NaN – callers must pre-mask.

  • y (np.ndarray, shape (n_obs,), dtype float) –

  • intercept (bool, default True) – If True, the leading entry is the fitted intercept; if False, it’s omitted.

Returns:

beta

Return type:

np.ndarray, shape (n_predictors + 1,) or (n_predictors,)

Notes

Imported into api.py’s namespace; no direct call site found in core/colocalize.py (which uses mlr when both R2 and coefficients are needed) – provided as a standalone coefficients-only utility.