Bringing your own problem · step 5 of 6
Declare what you want to know
How do you get a decision's number out of a fitted surface?
A fitted surface is not an answer. The answer is a specific comparison, over a specific population, in a specific window, at a specific level — and axiom makes you write that down as an Estimand before it will produce a number for it.
That looks like ceremony until the day the window in your head and the window in the fit disagree. realize compares them and carries a ledger of every step it took to cross between them; the ledger is the part you show someone who has to trust the number.
from axiom.core import Intervention, Population, TimeWindow
from axiom.estimands import Estimand, Level, Quantity, realize
lift = Estimand(
name="lift_at_400_per_week",
quantity=Quantity(kind="contrast"),
treatment=leaflets,
intervention=Intervention(doses={"leaflets": 400.0}),
reference=Intervention(doses={"leaflets": 0.0}),
outcome=footfall,
population=Population(name="the_24_stores"),
window=TimeWindow(start=0, stop=1, basis="per_period"),
level=Level(unit="individual"),
dimension=D.outcome,
)
got = realize(lift, result, assume_identified=True, mass=0.9, seed=0)
print(f"{lift.name}")
print(f" {got.summary.mean:+.2f} {footfall.unit} {got.summary.interval}")
print(f" status : {got.status}")
print()
for line in got.ledger:
print(f" [{line.kind}] {line.statement}")
lift_at_400_per_week +5.78 visits/week [2.9, 8.5] (90% HDI) status : downgraded [assume_identified] proceeded with 'lift_at_400_per_week' under assume_identified=True; the verdict was not supplied
Every line above was captured by running this code at build time. The steps share one namespace, so the code on this page is the code you would type after the steps before it.