Conditional-flow nested sampling MVP

experiment.py implements a small eight-well, 8-D score landscape and compares:

  • baseline: prior rejection for each constrained replacement;
  • idea: an online affine Gaussian flow fitted to the current live set, candidate filtering, exact p0/q importance weights, and weighted resampling.

It also checks two claims from the proposal:

  1. independent Beta(N, 1) shrinkage has E[log t] = -1/N;
  2. importance weighting recovers constrained-prior moments from a deliberately biased proposal.

Run:

/home/maxwelhelp/main/bin/python3 experiment.py

The run writes results.json. With seed 3133, N=64, D=8, and 120 replacements, the Beta check gives mean log shrinkage -0.0156288 versus -0.015625 (relative error 0.024%). The importance-weighted constrained mean differs from an independent prior reference by RMSE 0.0275 per coordinate scale, with ESS 639 out of 21,600 accepted proposal points.

In the matched toy replacement run, the baseline uses 308 score evaluations total (2.57 per replacement), while the fixed flow batches use 15,360 (128 per replacement). The flow's mean proposal acceptance is 0.500 and mean importance ESS is 42.4 per accepted batch, but this does not compensate for evaluating the whole batch. Thus this MVP verifies the mathematical correction mechanism and shrinkage law, but does not demonstrate the claimed 5x evaluation reduction.