-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathroberto.py
29 lines (21 loc) · 1.32 KB
/
roberto.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from bilby_result_classes import PolyChordResult, MultiNestResult, DynestyResult, UltraNestResult, JaxNSResult, NessaiResult, DynamicDynestyResult
import bilby
def summarize(json, **kwargs):
print("")
print(json)
res = bilby.result.read_in_result(json, **kwargs)
methods = ["kish", "unbiased_kish", "information", "mean", "bootstrap"]
ess = {method: res.ess(method=method, nsamples=100) for method in methods}
ess = {k: v for k, v in ess.items() if v is not None}
print("Effective sample size = ", ess)
metric = {method: res.metric(method=method, nsamples=100) for method in methods}
metric = {k: v for k, v in metric.items() if v is not None}
print("Efficiency (ESS / # like calls) = ", metric)
print("Test = ", res.test())
#summarize("results2D/ultranest_EggBox_result.json", result_class=UltraNestResult)
#summarize("results2D/pypolychord_EggBox_result.json", result_class=PolyChordResult)
#summarize("results2D/dynesty_EggBox_result.json", result_class=DynestyResult)
summarize("results2D/jaxns_EggBox_result.json", result_class=JaxNSResult)
summarize("results2D/nessai_EggBox_result.json", result_class=NessaiResult)
# summarize("results2D/pymultinest_EggBox_result.json", result_class=MultiNestResult)
summarize("results2D/dynamic_dynesty_EggBox_result.json", result_class=DynamicDynestyResult)