Designing an experiment before there is any data · step 2 of 6
Where to point the counter
Which angles carry the evidence — and which carry it under attack?
Evidence per hour is easy to compute: how many nats an hour at each angle buys, if you believe the model. Follow it and you put the whole budget where the counts are. That is the trap this step exists to name.
Evidence-per-hour is computed inside the model that is under attack. An objector who says the multiple-scattering core is wider than you fitted takes most of it away. surviving_evidence asks what is left when they do — and the answer is a different set of angles, far out in the tail.
import numpy as np
angles = np.array([1.0, 2.5, 5.0, 10.0, 20.0, 45.0, 90.0, 150.0])
omega = s.widest_aperture(angles, s.HARD_CENTRE)
believed = s.weight_of_evidence(
s.rate_per_steradian(angles, s.HARD_CENTRE) * omega * 3600.0,
s.rate_per_steradian(angles, s.DIFFUSE) * omega * 3600.0,
)
attacked, _ = s.surviving_evidence(angles, omega, 3600.0)
print(f"{'angle':>8} {'nats/h believed':>18} {'nats/h attacked':>18}")
for a, b, k in zip(angles, believed, attacked):
print(f"{a:7.1f}d {b:18,.0f} {k:18,.1f}")
print()
best_believed = angles[int(np.argmax(believed))]
best_attacked = angles[int(np.argmax(attacked))]
print(f"believe the model, and the best angle is {best_believed:.1f} degrees")
print(f"let it be attacked, and it is {best_attacked:.1f} degrees")
angle nats/h believed nats/h attacked
1.0d 2,744 2,696.5
2.5d 13,029 1.7
5.0d 97,394 17.9
10.0d 82,606 32.0
20.0d 67,717 0.7
45.0d 50,649 531.9
90.0d 20,659 535.9
150.0d 4,870 4,869.8
believe the model, and the best angle is 5.0 degrees
let it be attacked, and it is 150.0 degrees
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.