cleverly.interventions.Shift#
- class cleverly.interventions.Shift(delta: float, cap: float | DoseQuantile | SupportBoundary | None, name: str = '', target: Literal['population', 'fold_average'] | None = None)[source]#
Add
deltato everyone’s treatment, up tocap.- Parameters:
- delta
float How far to move the treatment.
0.0is the natural course – the policy that changes nothing – whose mean is \(E[Y]\) and which is the usual reference.- cap
float,DoseQuantile,SupportBoundaryorNone The largest treatment value the policy will assign; a unit whose shifted dose would exceed it keeps its own. Required, with no default, and it is a declaration rather than something estimated.
Estimating \(u(w)\) from the data would make the parameter data-dependent: the reported standard error would condition on a fitted support boundary, and every bootstrap replicate would target a slightly different policy. Defaulting it to
max(A)is worse, pinning the estimand to an extreme order statistic. So the analyst says what dose is achievable, which is a question about the world.cap=Nonemeans no cap. It is allowed, it is the same arithmetic with the indicator zeroed, and it warns with the share of rows whose shifted dose leaves the observed range – because there \(\bar Q\) is being extrapolated and identification needs \(A + \delta\) to be supported. A tuner,DoseQuantileorSupportBoundary, reads the cap from the treatment law;targetthen declares the parameter.- name
str What this policy is called in reported parameter names. Defaults to
"+0.5"/"-1"style, with"natural course"fordelta=0.- target{“population”, “fold_average”}
orNone The parameter of a map whose cap is a tuner, and
Nonefor a declared cap. A fit refuses a tuned map with no target (cleverly.interventions.tuning). The interval of the"population"target needs a consistent outcome regression near the boundary at each tuned node: the variance term of the tuner reads it.
- delta
Methods#
Attributes#
- Shift.cap: float | DoseQuantile | SupportBoundary | None#