Local information screening¶
See the complete example and qualification scope.
trade_study.FisherContext(parameter_names, parameter_coordinates, parameter_scales, observation_model, design, reference_regime, nuisance_treatment, sensitivity_reference, numerical_reference, qualification_reference, information_reference)
dataclass
¶
Caller-owned meaning and qualification of an information matrix.
All references are nonempty caller identifiers whose underlying evidence
must be retained. They are declarations, not automatically verified hashes.
The supplied matrix is already in parameter_coordinates with the
recorded parameter_scales; this adapter applies no further scaling.
Attributes:
| Name | Type | Description |
|---|---|---|
parameter_names |
tuple[str, ...]
|
Ordered matrix coordinates, distinct and nonempty. |
parameter_coordinates |
str
|
Coordinate/transform definition and units. |
parameter_scales |
tuple[float, ...]
|
Positive finite scales already used by the caller. |
observation_model |
str
|
Measurement law, noise and observation definitions. |
design |
str
|
Experimental design identity. |
reference_regime |
str
|
Parameter point or declared sampled regime. |
nuisance_treatment |
str
|
Explicit conditioning/profiling convention. |
sensitivity_reference |
str
|
Measured-output sensitivity source. |
numerical_reference |
str
|
Solver, derivative and numerical settings. |
qualification_reference |
str
|
Independent qualification and its scope. |
information_reference |
str
|
Identity of the caller's information artifact. |
__post_init__()
¶
Detach coordinate sequences and require explicit context.
Raises:
| Type | Description |
|---|---|
ValueError
|
If names, scales or context references are invalid. |
Source code in src/trade_study/fisher.py
to_metadata()
¶
Return detached primitive JSON context.
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
Explicit coordinates and caller-owned evidence references. |
Source code in src/trade_study/fisher.py
trade_study.FisherScreenPolicy(threshold, directions=None, atol=1e-10, rtol=1e-08, max_parameters=128)
dataclass
¶
Prespecified local minimum-eigenvalue screen.
Attributes:
| Name | Type | Description |
|---|---|---|
threshold |
float
|
Required minimum eigenvalue, finite and nonnegative. |
directions |
tuple[tuple[float, ...], ...] | None
|
Optional row-major p-by-k orthonormal direction basis in the matrix coordinates. The tested matrix is B.T @ F @ B. Its complement is fixed; this operation does not profile nuisance parameters. None tests all directions. |
atol |
float
|
Absolute symmetry and positive-semidefiniteness tolerance. |
rtol |
float
|
Relative symmetry and positive-semidefiniteness tolerance. |
max_parameters |
int
|
Dense matrix dimension limit, default 128. This is not a whole-process memory bound. |
__post_init__()
¶
Validate the policy before evaluating any design.
Raises:
| Type | Description |
|---|---|
ValueError
|
If bounds or the orthonormal basis are invalid. |
Source code in src/trade_study/fisher.py
constraint(observable='fisher_min_eigenvalue')
¶
Build the existing deterministic feasibility constraint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
observable
|
str
|
Scored column name. |
'fisher_min_eigenvalue'
|
Returns:
| Type | Description |
|---|---|
Constraint
|
A >= constraint without an invented confidence level. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the observable name is empty. |
Source code in src/trade_study/fisher.py
to_metadata()
¶
Return detached primitive JSON policy values.
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
Threshold, basis, numerical tolerances and dense dimension limit. |
Source code in src/trade_study/fisher.py
trade_study.FisherScreenResult(status, reason, eigenvalues, matrix_digest, context, policy)
dataclass
¶
A local screen outcome retaining its context and numerical evidence.
Attributes:
| Name | Type | Description |
|---|---|---|
status |
ScreenStatus
|
Feasible, infeasible, unreadable or failed. |
reason |
str
|
Machine-readable outcome explanation or upstream failure text. |
eigenvalues |
tuple[float, ...]
|
Actual tested eigenvalues; empty for unavailable results. |
matrix_digest |
str | None
|
SHA256 of the supplied host float64 little-endian matrix bytes in C order, before symmetrization; None for missing inputs. |
context |
FisherContext
|
Caller-owned scientific and numerical declarations. |
policy |
FisherScreenPolicy
|
The prespecified screen. |
as_scores(observable='fisher_min_eigenvalue')
¶
Expose a readable result to an existing scorer/constraint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
observable
|
str
|
Scored column name. |
'fisher_min_eigenvalue'
|
Returns:
| Type | Description |
|---|---|
dict[str, float]
|
The actual minimum tested eigenvalue in a single scored column. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the result is unavailable or the name is empty. |
Source code in src/trade_study/fisher.py
to_metadata()
¶
Return a result-bundle-compatible record without nonfinite sentinels.
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
Versioned primitive JSON with actual values and preserved context. |
Source code in src/trade_study/fisher.py
trade_study.screen_fisher(information, *, context, policy, failure=None)
¶
Screen a caller-qualified host information matrix in declared directions.
No derivatives, Fisher model, scaling, nuisance profile, statistical uncertainty or global identifiability conclusion is constructed here. The caller explicitly transfers native backend artifacts to host NumPy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
information
|
NDArray[float64] | None
|
Real host NumPy p-by-p matrix, or None when unavailable. |
required |
context
|
FisherContext
|
Ordered coordinates and retained qualification references. |
required |
policy
|
FisherScreenPolicy
|
Prespecified threshold, directions and numerical limits. |
required |
failure
|
str | None
|
Upstream failure reason, supplied only with information=None. |
None
|
Returns:
| Type | Description |
|---|---|
FisherScreenResult
|
A readable local result, an unreadable invalid/unsupported input, or |
FisherScreenResult
|
a failed upstream/eigensolver record. No input matrix is retained. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If failure is empty or supplied alongside a matrix. |
Source code in src/trade_study/fisher.py
trade_study.fisher_screen_counts(records, *, planned_ids)
¶
Count outcomes against a fixed declared cohort without dropping failures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
records
|
Mapping[str, FisherScreenResult]
|
At most one outcome per planned identifier. |
required |
planned_ids
|
Sequence[str]
|
Complete, distinct, nonempty planned replicate/task IDs. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
Planned, feasible, infeasible, unreadable, failed and missing counts. |
dict[str, int]
|
These counts alone establish no probability, interval or gate verdict. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If identities or result statuses are invalid. |