Skip to content

Commit

Permalink
modifying the kl stats function to return dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
htjb committed Nov 8, 2023
1 parent 791cc40 commit 82bfb77
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions margarine/marginal_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,15 @@ def mask_arr(arr):
kl_array = np.sort([midkl, dekl, thetakl])
bd_array = np.sort([midbd, debd, thetabd])

results_dict = {
"Statistic": ["KL Divergence", "BMD"],
"Value": [kl_array[1], bd_array[1]],
"Lower Bound": [kl_array[0], bd_array[0]],
"Upper Bound": [kl_array[2], bd_array[2]],
results = {
"KL Divergence": kl_array[1],
"KL Lower Bound": kl_array[0],
"KL Upper Bound": kl_array[2],
"BMD": bd_array[1],
"BMD Lower Bound": bd_array[0],
"BMD Upper Bound": bd_array[2],
}

results = pd.DataFrame(results_dict)
results.set_index("Statistic", inplace=True)

return results

def integrate(
Expand Down

0 comments on commit 82bfb77

Please sign in to comment.