Skip to content

Commit

Permalink
added ratio to table
Browse files Browse the repository at this point in the history
  • Loading branch information
comane committed Jun 27, 2023
1 parent 845eccb commit d6580ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions validphys2/src/validphys/closuretest/multiclosure_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ def datasets_bias_variance_pdf_covmat(datasets_expected_bias_variance_pdf_covmat
"""
records = []
for ds, (bias, var, ndata) in zip(each_dataset, datasets_expected_bias_variance_pdf_covmat):
records.append(dict(dataset=str(ds), ndata=ndata, bias=bias, variance=var))
records.append(dict(dataset=str(ds), ndata=ndata, bias=bias, variance=var, ratio=bias / var, ratio_sqrt=np.sqrt(bias/var)))
df = pd.DataFrame.from_records(
records, index="dataset", columns=("dataset", "ndata", "bias", "variance")
records, index="dataset", columns=("dataset", "ndata", "bias", "variance", "ratio", "ratio_sqrt")
)
df.columns = ["ndata", "bias", "variance"]
df.columns = ["ndata", "bias", "variance", "ratio", "sqrt(ratio)"]
return df


Expand Down

0 comments on commit d6580ec

Please sign in to comment.