Tutorials · 5 problems
Worked all the way through
Most library tours show you a subpackage at a time. These take a single problem and carry it through every phase it actually has to survive — because the hard part of causal work is not any one phase, it is that they have to agree with each other at the end.
Start with the porting one if you have a table and want to know what it takes to get it into axiom at all. It imports no simulator: every object you would have to write yourself is written on the page — the column roles, the treatment and outcome with their dimensions, the model spec, the estimand — and it ends where an honest porting exercise ends, with a number and a precise statement of the one thing standing between it and a causal claim.
Next to it, a model of your own, for when the kernels do not fit your mechanism. It writes the mean as an expression by hand, gets the dimensions checked before anything is fitted, and is honest about what leaving the kernels behind costs you.
The other two are the two shapes the work itself comes in. In one, the data already exists and the question is whether it can answer anything — it cannot, so an experiment gets designed, and its answer reverses the decision the existing data would have supported.
In the other there is no data at all. Every step is a decision about what to go and measure: which angles, what shape of aperture, how long at each, and when you are allowed to stop. It is the older discipline and the one that is easier to get wrong, because nothing pushes back until the money is spent.
Every number on every page below was produced by running the code shown beside it, when this site was built.
A porting story · 6 steps
Bringing your own problem
Twenty-four stores, forty weeks, leaflet spend and footfall. How do you turn a table you already have into a model axiom can fit, an estimand it can read, and a number you could defend?
The other two series start from a world that already exists — a simulator in one, a physics module in the other — which is fine for telling a story and no help at all when what you have is a CSV. Nothing in this one imports axiom.sim. Every object you would have to write is written on the page: the roles, the entities and their dimensions, the spec, the estimand.
STEP 1
Start from the dataframe you already have
What does axiom need to know about your table?
Read it
STEP 2
Say what the columns mean
Why does a column need a dimension and a unit?
Read it
STEP 3
Write the spec
What shape do you believe the response has, and how sure are you?
Read it
STEP 4
Fit it, and read what came back
Did the model find the response, and what did the spec cost you?
Read it
STEP 5
Declare what you want to know
How do you get a decision's number out of a fitted surface?
Read it
STEP 6
What you have not done yet
The number came back downgraded. Why, and what fixes it?
Read it
A modelling story · 5 steps
A model of your own
Your response is an exponential approach to a ceiling, and no kernel on the menu is that shape. How do you write the mean yourself, get it checked, and fit it — and what do you give up by leaving the kernels?
A `ModelSpec` is the object underneath everything else: a mean written as a typed expression, the outcome it predicts, the likelihood around it, and every parameter with a prior. `SurfaceSpec` builds one and hands it to the same backends. Writing one yourself is the route the physics case study takes, on a response small enough to read in five steps.
STEP 1
When the kernels run out
What if the shape you need is not one of the ones on offer?
Read it
STEP 2
The mean, as an expression
How do you write a formula axiom can differentiate and check?
Read it
STEP 3
Dimensions are checked when you build it
What stops you writing a formula that cannot mean anything?
Read it
STEP 4
Fit it
How does a hand-built model reach a backend?
Read it
STEP 5
What the custom route costs you
You left the kernels behind. What did you leave with them?
Read it
An analysis story · 8 steps
One question, carried all the way
A logistics operator runs 40 distribution depots in one region and 500 nationally. Should the standing weekly maintenance schedule go from nothing to 60 hours per depot?
Identification refuses the panel on hand, so an experiment is designed, sized against the boundary the decision turns on, and run. Its answer is folded back into the model — and it reverses the decision the observational fit would have made.
STEP 1
The question, written down
What are we actually deciding, and what would 'yes' have to beat?
Read it
STEP 2
Can the data we already have answer it?
Is the effect identified from the panel already on hand?
Read it
STEP 3
The belief we start from
What does the observational fit say, and how much should we trust it?
Read it
STEP 4
Designing the experiment
How big does the trial need to be, and is the answer worth its cost?
Read it
STEP 5
The experiment lands
What did it measure, and does the model we already had agree?
Read it
STEP 6
Folding the experiment into the model
What does the model say once it has to honour the measurement?
Read it
STEP 7
Planning the follow-up
Should we repeat this, when does it go stale, and what next?
Read it
STEP 8
The report
How does the whole of this become a document someone can check?
Read it
A transfer story · 6 steps
Making a model travel
A household water-filter programme was evaluated in one district over twelve weeks, per household. The decision is in a different district, per person, over a year. What has to be true for the first number to be an answer to the second question — and what does it cost to assume it?
This is the failure mode that survives every other check. The identification was fine, the fit was fine, the interval was honest, and the number was still wrong where it landed, because nobody wrote down that the question had changed on the way. Eight facets, a selection diagram, four things a graph can say, and a ledger you could hand to somebody who has to sign for it.
STEP 1
The number you have is not the number you need
You have a defensible result. Why can you not just use it?
Read it
STEP 2
Ask the graph about the population
Is a difference between two populations a difference that matters?
Read it
STEP 3
Four things the graph can say
What happens when the populations differ somewhere worse?
Read it
STEP 4
The facets a graph cannot settle
The population is licensed. What about the window and the level?
Read it
STEP 5
Correct it, and watch the interval widen
What do the assumptions actually do to the number?
Read it
STEP 6
The ledger is the deliverable
What do you hand the person who has to sign off on this?
Read it
A design story · 6 steps
Designing an experiment before there is any data
Is the positive charge of an atom concentrated in a small hard centre, or spread through the whole atom? Both models fit everything known in 1910. What experiment would tell them apart — and specifically, which scattering angles, what shape of aperture, and for how long?
Nothing here is an analysis. Every step decides what to go and measure, and the whole argument turns on noticing that the two rival atoms are one model at two values of one number. That is what gives the experiment a resolving power, a sensitivity curve, and a rule for when to stop.
STEP 1
Two atoms, one number
How do you get resolving power against a question nobody has measured?
Read it
STEP 2
Where to point the counter
Which angles carry the evidence — and which carry it under attack?
Read it
STEP 3
What shape to cut the aperture
Same solid angle, same counts — does the shape matter?
Read it
STEP 4
How long at each, and what the plan buys
Two hundred hours. Where do they go, and what comes back?
Read it
STEP 5
When to stop
The witness runs for 110 hours. Do you have to wait?
Read it
STEP 6
Running it
The counts come in. What does the experiment actually say?
Read it
Then what
Where to go after them
The two worked problems exist at full length as notebooks, with every
intermediate result the site's path leaves out: nbs/tutorial/ and
nbs/case-studies/rutherford/. For the porting path, every symbol it
uses is demonstrated on its own in nbs/surface/ and
nbs/estimands/.
For the same phases taken further one at a time, the five pillar pages start at Identify. For the same library in twelve other fields, the examples. For the scattering study written up as a finished argument rather than as a tutorial, see GEIGER-1911; for a sequential trial that has to stop an arm early, HYPER-3.