Files
pokerfreak/messung/fremd/3_eval/rust_seeds2.py
T

10 lines
781 B
Python

"""Rust-MC Flop-Stelle: 300 Seeds x 10 Mio., Verteilung der z-Werte (Schwanz, Normalitaet)."""
import json, subprocess, statistics
e = json.load(open("exakt_equity.json"))["AhKh vs 9c9d, Flop Qh7h2c"]["eigen"][0]
EXE = "../../../target/release/pokerbench-fremd-eval.exe"
zs = []
for sd in range(1000, 1300):
r = subprocess.run([EXE, "equity", "Ah Kh", "Qh 7h 2c", "10000000", str(sd), "9c 9d"], capture_output=True, text=True, check=True).stdout.split()
zs.append((float(r[0]) - e) / float(r[1]))
print(f"Flop, 300 Seeds x 10 Mio.: Mittel z {statistics.mean(zs):+.3f} (Fehler {1/300**.5:.3f}), Streuung z {statistics.stdev(zs):.3f}, max |z| {max(abs(x) for x in zs):.2f}, Anteil |z|>2: {sum(abs(x)>2 for x in zs)/300:.3f} (soll 0.046), |z|>3: {sum(abs(x)>3 for x in zs)}")