Skip to content

factrix.list_estimators

list_estimators(scope: FactorScope, signal: Signal, *, format: Literal['text', 'json'] = 'text', with_import: bool = False) -> list[str] | list[dict[str, Any]]

Return Estimator instances applicable to (scope, signal).

Mirrors :func:list_metrics shape so callers can build a single pre-flight pattern: list_metrics says which scalars a cell can emit, list_estimators says which inference methods can drive the family function's estimator= kwarg for that cell. Mode is intentionally not an input — Estimator applicability is not mode-dependent.

Parameters:

Name Type Description Default
scope FactorScope

Cell axis to filter on (FactorScope.INDIVIDUAL or FactorScope.COMMON).

required
signal Signal

Cell axis to filter on (Signal.CONTINUOUS or Signal.SPARSE).

required
format Literal['text', 'json']

"text" (default) returns Estimator names sorted alphabetically. "json" returns list[dict] rows with keys name, description, import_path.

'text'
with_import bool

"text" only. When True, returns "name → import_path" two-column lines so each row is copy-paste-ready into from factrix.stats import <name>. Ignored under JSON (import_path is always present there).

False

Raises:

Type Description
IncompatibleAxisError

(scope, signal) matches no registered Estimator. NeweyWest applies to every user-facing cell, so as long as it stays in the registry this branch is defensive.

Examples:

Discover applicable estimators for an INDIVIDUAL × CONTINUOUS cell:

>>> import factrix as fx
>>> names = fx.list_estimators(
...     fx.FactorScope.INDIVIDUAL, fx.Signal.CONTINUOUS,
... )

JSON form for tooling:

>>> rows = fx.list_estimators(
...     fx.FactorScope.INDIVIDUAL, fx.Signal.CONTINUOUS, format="json",
... )

Programmatic discovery of inference methods (Estimator instances) applicable to a given (scope, signal) cell — the inference-side twin of list_metrics.

Two contracts to keep in mind:

  • Cell → procedure is 1:1 (per #148). A cell's primary p-value is produced by exactly one estimator at evaluate time.
  • Family functions accept an estimator= override. bhy / bhy_hierarchical / partial_conjunction swap which already-computed p-value drives the multiplicity step. list_estimators returns the candidates for that override, filtered to those applicable to the cell.

Mode axis is not an input

Mode is intentionally not a parameter — estimator applicability is cell-axis-dependent (scope × signal), not panel-shape-dependent. See the docstring Examples block above for the canonical text-list and JSON-form calls.


See also