cleverly.estimators.DoseResponseResult#
- class cleverly.estimators.DoseResponseResult(curve: DoseResponse, estimates: dict[str, ParameterEstimate], band: SimultaneousBands, pair_support: tuple[PairSupport, ...], quadrature_shift: float, scores: dict[str, float], n_nodes: int, alpha: float, nuisance_record: DoseNuisanceRecord, warnings: tuple[str, ...] = (), backend: str | None = None)[source]#
A fitted kernel-smoothed dose-response curve.
- Parameters:
- curve
DoseResponse The declaration.
- estimates
dict One
ParameterEstimateper pair, keyed by name.- band
SimultaneousBands The simultaneous band over every declared pair.
- pair_support
tupleofPairSupport One entry per reported estimate, in report order: every pair, and within a fit with baseline strata every pair in every stratum.
- quadrature_shift
float The largest change of an estimate, relative to its standard error, when the quadrature nodes are doubled.
- scores
dict The mean weighted score of each pair’s fluctuation at its solution.
- n_nodes
int The quadrature doses.
- alpha
float The significance level of the intervals and of the band.
- nuisance_record
DoseNuisanceRecord The outcome regression at the observed dose, which
diagnostics.nuisance_models()reads.- warnings
tupleofstr The fit’s notes: a quadrature-doubling shift above tolerance, an accepted composition no registered study measures (an in-sample fit, observation weights), and pairs below the support floor.
- backend
strorNone The dataframe library the fit’s data arrived in, which
to_frame()returns by default.
- curve
Methods#
- DoseResponseResult.assess(*, include_refits: bool = False, include_retargets: bool = False, arguments: Mapping[str, Mapping[str, Any]] | None = None, random_state: int | None = None) Any[source]#
Run the applicable post-fit assessment battery.
No refutation or sensitivity analysis is implemented for a dose-response curve, so those rows report their refusals.
- Parameters:
- Returns:
AssessmentReportValidation, diagnostics, and sensitivity in one report.
- DoseResponseResult.estimate(h: float, a0: float, stratum: str | None = None) ParameterEstimate[source]#
The estimate at one declared pair.
- Parameters:
- Returns:
ParameterEstimateThe estimate.
- Raises:
KeyErrorWhen no declared pair has exactly this bandwidth and dose, and no declared pair has the parameter name
cleverly.dose_response.pair_name()gives them.
Notes
A pair matches by exact float equality first, then by its declared name, which formats each number to ten significant digits and is unique within a declaration. No tolerance is applied: two declared doses can be close in relative terms and still be different estimands.
- DoseResponseResult.save(path: Any) Any[source]#
Write this result to a trusted joblib artifact; see
cleverly.load().- Parameters:
- pathpath-like
Destination file.
- Returns:
PathThe destination path, as given.
Attributes#
- DoseResponseResult.assessment_family: ClassVar[str] = 'dose_response'#
The assessment family: one declaration per assessment operation in
cleverly.assessment.ASSESSMENT_CAPABILITIES.
- DoseResponseResult.diagnostics#
The support, score, outcome-regression and influence diagnostics of the fit.
- DoseResponseResult.replayability#
Which assessment operations survive from the stored fit.
- DoseResponseResult.sensitivity#
The sensitivity-analysis facade, whose every row refuses on this fit.
- DoseResponseResult.curve: DoseResponse#
- DoseResponseResult.estimates: dict[str, ParameterEstimate]#
- DoseResponseResult.band: SimultaneousBands#
- DoseResponseResult.pair_support: tuple[PairSupport, ...]#
- DoseResponseResult.nuisance_record: DoseNuisanceRecord#
- DoseResponseResult.assessment_cache: AssessmentCache#
Assessment results keyed by operation and normalized arguments.
init=False, so a mapping handed to the constructor bydataclasses.replacecannot answer for another fit.