#!/usr/bin/env python3 """Write the hybrid prediction table (h__.json from h4321.c) as a pre-registration, before any comparison. Usage: prereg4321.py > prereg4321.md""" import json XS = (23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101) PS = (5, 7, 11, 13, 17, 19, 23, 29, 31, 37) print("# Pre-registration, job 4321 (route 82): exact-small-prime hybrid predictions\n") print("Written before any comparison with the exact brackets in this job. Model: h4321.c (heuristic; no fitted parameter). Small primes 5 <= q <= y are enumerated exactly over all prod(q-2) start classes; M3's second-cumulant interior expansion runs over y < q <= x only. NMAX = 200 (gap values and a+b up to 1200).") print("Seen before writing this: the brief of job 4321 quotes two brackets from #1930, p = 13 at T53 [0.4530, 0.4536] and p = 29 at T101 [0.5263, 0.5882]. No other bracket was opened in this job.\n") print("Criteria (copied from the route step): SUCCESS if at y = 13 the hybrid is inside or within 0.02 of every bracket with half-width <= 0.05 for p = 5..37 and x = 53..101, including p = 37 at T53. FAILURE if at y = 13 the p = 37 T53 miss stays above 0.05, or the hybrid is further from the bracket than M3 at more than 10% of those cells. Otherwise neither branch; report the distances. y = 11 and y = 17 are reported for convergence only; the verdict uses y = 13.\n") for y in (11, 13, 17): print("## y = %d\n" % y) print("| x | " + " | ".join("p=%d" % p for p in PS) + " |") print("|---|" + "---|" * len(PS)) for x in XS: f = json.load(open("h_%d_%d.json" % (x, y)))["folds"] print("| %d | " % x + " | ".join("%.4f" % f[str(p)] if str(p) in f else "-" for p in PS) + " |") print()