import json from conditional_cluster_sampler import run_case, transition, exact_terminal_probability # Fixed seeds and bounded proposal budget make this reproducible and safe to run. results = [run_case(a) for a in (0.05, 0.005, 0.0005)] checks = [] for r in results: checks.append({ "a": r["a"], "prediction_acceptance_Z": r["acceptance_pred"], "observed_acceptance": r["proposal_acceptance"], "relative_error": abs(r["proposal_acceptance"]-r["acceptance_pred"])/r["acceptance_pred"], "prediction_rejection_cost_1_over_Z": r["rejection_cost_pred"], "observed_cluster_valid_fraction": r["cluster_valid"], "cluster_mean": r["cluster_mean"], "exact_conditioned_mean": r["exact_mean"], "conditioned_TV_error": r["tv"], "cluster_ESS": r["cluster_ess"], "local_Gibbs_ESS": r["local_ess"], }) with open("results.json", "w") as f: json.dump({"settings": {"T": 10, "n_cluster": 200, "n_proposals": 20000, "seed": 123}, "checks": checks}, f, indent=2) for row in checks: print(json.dumps(row))