pymixef.compare module¶
Cross-platform parameter and objective comparison.
- class pymixef.compare.ComparisonResult(table, compatibility, objective_difference, conventions)[source]¶
Bases:
objectAligned comparison plus its convention-compatibility report.
- Parameters:
table (DiagnosticTable)
compatibility (CompatibilityReport)
objective_difference (float | None)
conventions (Mapping[str, Any])
- table: DiagnosticTable¶
- compatibility: CompatibilityReport¶
- objective_difference: float | None¶
- conventions: Mapping[str, Any]¶
- class pymixef.compare.ApproximationSensitivityResult(table, fits, failures, baseline, settings, materiality)[source]¶
Bases:
objectCross-setting refit comparisons with explicit failure accounting.
- Parameters:
table (DiagnosticTable)
fits (Mapping[str, FitResult])
failures (tuple[Mapping[str, Any], ...])
baseline (str)
settings (Mapping[str, Mapping[str, Any]])
materiality (Mapping[str, float])
- table: DiagnosticTable¶
- failures: tuple[Mapping[str, Any], ...]¶
- baseline: str¶
- settings: Mapping[str, Mapping[str, Any]]¶
- materiality: Mapping[str, float]¶
- property successful_scenarios: int¶
Number of settings whose fit completed successfully.
- property failed_scenarios: int¶
Number of settings whose fit failed or returned unusable output.
- pymixef.compare.approximation_sensitivity(fit_function, scenarios, *, materiality, baseline=None)[source]¶
Refit named approximation settings and compare aligned outputs.
fit_functionreceives an independent deep copy of one settings mapping per scenario. The baseline must succeed; other failures are retained with scenario, exception type, and message. Successful fits must expose the same parameter names and an aligned parameter covariance matrix. The tidy result reports parameter, standard-error, and objective changes relative to the baseline.materialitymust define nonnegative thresholds namedparameter_relative,standard_error_relative, andobjective_absolute. Per-row flags preserve the caller’s scientific decision rule instead of embedding an undocumented universal threshold.This callback-based contract supports sensitivity analyses such as Laplace optimizer tolerances, MMRM covariance/degree-of-freedom choices, or ODE solver tolerances without embedding engine-specific assumptions.
- Parameters:
fit_function (Callable[[Mapping[str, Any]], FitResult])
scenarios (Mapping[str, Mapping[str, Any]])
materiality (Mapping[str, float])
baseline (str | None)
- Return type:
- pymixef.compare.compare(fit, *, reference, mapping=None, conventions=None)[source]¶
Compare a fit with a reference under matched objective conventions.
Parameter estimates are always aligned independently. Objective differences are calculated only when the reference declares the same method, normalization-constant policy, and objective convention archived by the PyMixEF fit.
- Parameters:
fit (FitResult)
reference (Any)
mapping (Mapping[str, str] | None)
conventions (Mapping[str, Any] | None)
- Return type: