Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion experiments/analyze_estimated.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def summarize(release: pd.DataFrame, results: pd.DataFrame) -> pd.DataFrame:
realized_gain_pp=("realized_gain_pp", "mean"),
robust_lower_bound_pp=("robust_lower_bound_pp", "mean"),
)
# Gains are percentage points; tied repetitions can retain ~1e-14 roundoff.
summary = repetition.groupby(["scenario", "alpha"], as_index=False).agg(
repetitions=("realized_gain_pp", "size"),
move_share=("move_share", "mean"),
Expand All @@ -82,7 +83,7 @@ def summarize(release: pd.DataFrame, results: pd.DataFrame) -> pd.DataFrame:
conditional_gain_se=("conditional_gain_pp", "sem"),
realized_gain_pp=("realized_gain_pp", "mean"),
realized_gain_se=("realized_gain_pp", "sem"),
positive_realized_share=("realized_gain_pp", lambda x: (x > 0).mean()),
positive_realized_share=("realized_gain_pp", lambda x: (x > 1e-9).mean()),
robust_lower_bound_pp=("robust_lower_bound_pp", "mean"),
)
summary["scenario"] = pd.Categorical(
Expand Down
3 changes: 2 additions & 1 deletion experiments/analyze_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def summarize(release: pd.DataFrame, results: pd.DataFrame) -> pd.DataFrame:
realized_gain_pp=("realized_gain_pp", "mean"),
joint_realized_gain_pp=("joint_realized_gain_pp", "mean"),
)
# Gains are percentage points; tied repetitions can retain ~1e-14 roundoff.
summary = (
repetition_means.groupby("alpha", as_index=False)
.agg(
Expand All @@ -52,7 +53,7 @@ def summarize(release: pd.DataFrame, results: pd.DataFrame) -> pd.DataFrame:
expected_gain_pp=("expected_gain_pp", "mean"),
realized_gain_pp=("realized_gain_pp", "mean"),
realized_gain_se=("realized_gain_pp", "sem"),
positive_repetition_share=("realized_gain_pp", lambda x: (x > 0).mean()),
positive_repetition_share=("realized_gain_pp", lambda x: (x > 1e-9).mean()),
)
.sort_values("alpha")
)
Expand Down
33 changes: 33 additions & 0 deletions experiments/tests/test_positive_gain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Roundoff in tied repetitions must not count as a realized improvement."""

from pathlib import Path

import pandas as pd
import pytest

from experiments import analyze_estimated, analyze_oracle


@pytest.mark.parametrize(
("analyzer", "experiment", "share"),
[
(analyze_oracle, "oracle", "positive_repetition_share"),
(analyze_estimated, "estimated", "positive_realized_share"),
],
)
def test_positive_share_excludes_roundoff(analyzer, experiment, share) -> None:
directory = Path(__file__).parents[2] / "results" / experiment
template = pd.read_csv(directory / "matched_budget.csv", nrows=1).iloc[0]
rows = []
for repetition, gain in enumerate([1e-14, 0.1, -0.1]):
for alpha in [0.0, 1.0]:
row = template.copy()
row["repetition"] = repetition
row["alpha"] = alpha
row["realized_gain_pp"] = gain if alpha == 0 else 0.0
row["predicted_gain_pp"] = 0.0
rows.append(row)
release = pd.read_csv(directory / "release.csv", nrows=1)
summary = analyzer.summarize(release, pd.DataFrame(rows))
assert summary.loc[summary["alpha"] == 0, share].iloc[0] == pytest.approx(1 / 3)
assert summary.loc[summary["alpha"] == 1, share].iloc[0] == 0
4 changes: 2 additions & 2 deletions paper/generated/estimated_summary.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
Weak innovation & 1.0 & 3.02 & 8.3 & 8.3 & 8.3 & 0.00 [0.00, 0.00] & 0.00 [0.00, 0.00] \\
Overconfident & 0.0 & 0.00 & 0.0 & 12.4 & 0.0 & 7.21 [7.07, 7.35] & 0.00 [0.00, 0.00] \\
Overconfident & 0.5 & 5.42 & 9.4 & 12.9 & 9.5 & 0.35 [0.31, 0.38] & 0.15 [0.13, 0.17] \\
Overconfident & 1.0 & 7.57 & 13.3 & 13.3 & 13.3 & 0.00 [0.00, 0.00] & 0.00 [0.00, 0.00] \\
Overconfident & 1.0 & 7.58 & 13.3 & 13.3 & 13.3 & 0.00 [0.00, 0.00] & 0.00 [0.00, 0.00] \\
Underconfident & 0.0 & 0.00 & 0.0 & 12.3 & 0.0 & 7.41 [7.26, 7.56] & 0.00 [0.00, 0.00] \\
Underconfident & 0.5 & 2.76 & 3.8 & 12.5 & 3.5 & 3.03 [2.93, 3.13] & 0.84 [0.80, 0.88] \\
Underconfident & 0.5 & 2.77 & 3.8 & 12.5 & 3.5 & 3.03 [2.93, 3.13] & 0.84 [0.80, 0.88] \\
Underconfident & 1.0 & 7.45 & 13.4 & 13.4 & 13.4 & 0.00 [0.00, 0.00] & 0.00 [0.00, 0.00] \\
\bottomrule
\end{tabular}
Expand Down
Binary file modified paper/main.pdf
Binary file not shown.
14 changes: 7 additions & 7 deletions results/estimated_summary.csv
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
scenario,alpha,repetitions,move_share,nfr,operational_nfr,joint_nfr,joint_conditional_gain_pp,joint_conditional_gain_se,predicted_gain_pp,conditional_gain_pp,conditional_gain_se,realized_gain_pp,realized_gain_se,positive_realized_share,robust_lower_bound_pp,acceptance_rate,stress_pass
well_estimated,0,50,0,0,0.123477571421,0,0,0,7.75135887102,7.56409770084,0.0676617912284,7.535,0.173973992635,1,6.41365629137,1,True
well_estimated,0.25,50,0.0219333333333,0.0317658811534,0.12609410242,0.0313582841209,1.44743109627,0.0267787808885,4.08223593139,3.95369070105,0.0459930542857,3.97166666667,0.175086794155,1,3.06944844625,1,True
well_estimated,0.5,50,0.0382,0.066738232659,0.127274628633,0.0678076770685,0.497233310081,0.0124399437654,1.34749711525,1.28189993484,0.0247851070307,1.17,0.122496702718,0.92,0.733285052,1,True
well_estimated,0.75,50,0.05635,0.103253395862,0.129943799377,0.102753442398,0.0632836203793,0.00539940067628,0.229264979575,0.200351962465,0.0103543917344,0.258333333333,0.0574520405334,0.74,-0.0367964744625,1,True
well_estimated,0.5,50,0.0382,0.066738232659,0.127274628633,0.0678076770685,0.497233310081,0.0124399437654,1.34749711525,1.28189993484,0.0247851070307,1.17,0.122496702718,0.88,0.733285052,1,True
well_estimated,0.75,50,0.05635,0.103253395862,0.129943799377,0.102753442398,0.0632836203793,0.00539940067628,0.229264979575,0.200351962465,0.0103543917344,0.258333333333,0.0574520405334,0.68,-0.0367964744625,1,True
well_estimated,1,50,0.0742333333333,0.134473867648,0.134473867648,0.134473867648,0,0,0,0,0,0,0,0,0,1,True
small_history,0,50,0,0,0.133866055385,0,0,0,8.52793462902,6.83575611963,0.0881430170301,6.715,0.184644200357,1,3.9887414436,1,True
small_history,0.25,50,0.0231333333333,0.033595957268,0.136363906521,0.0366157421643,1.32631643861,0.0384292566535,4.50157633221,3.33999413466,0.0680039833984,3.29333333333,0.154912747002,1,1.11523198515,1,True
small_history,0.5,50,0.0411166666667,0.0750156106985,0.139556440045,0.0765086650212,0.363788923952,0.0232749956275,1.47775074038,0.899797545113,0.0607260111686,0.901666666667,0.135916515993,0.82,-0.519612571383,1,True
small_history,0.75,50,0.0610833333333,0.113380060614,0.143996160872,0.113578521213,0.0104359462426,0.0149652624254,0.243998068892,0.032819411748,0.0325898562188,0.005,0.0889409215623,0.5,-0.62088004321,1,True
small_history,0.75,50,0.0610833333333,0.113380060614,0.143996160872,0.113578521213,0.0104359462426,0.0149652624254,0.243998068892,0.032819411748,0.0325898562188,0.005,0.0889409215623,0.46,-0.62088004321,1,True
small_history,1,50,0.0788,0.148559261205,0.148559261205,0.148559261205,0,0,0,0,0,0,0,0,0,1,True
weak_innovation,0,44,0,0,0.0801359159636,0,0,0,1.39801975535,0.99787074852,0.0199574788768,1.14962121212,0.148488477667,0.840909090909,0.323438761433,0.88,True
weak_innovation,0.25,44,0.0127272727273,0.0192990745185,0.0808567666527,0.0200150708955,0.11104741661,0.00818757170337,0.79659030554,0.495948663703,0.0181939017366,0.564393939394,0.108066145967,0.75,-0.0173584483399,0.88,True
weak_innovation,0.5,44,0.0189393939394,0.0400410701441,0.0810988063993,0.0407113808756,0.0327787380114,0.00626469767122,0.334644119595,0.15387428644,0.0140084373206,0.183712121212,0.103652874727,0.613636363636,-0.198755857247,0.88,True
weak_innovation,0.75,44,0.0250568181818,0.0612320434923,0.0814181656663,0.0614687578399,-0.0140977505256,0.00583804044168,0.0791901651637,-0.000188120011818,0.00895259059699,0.032196969697,0.0658231469253,0.590909090909,-0.176321578516,0.88,True
weak_innovation,0.25,44,0.0127272727273,0.0192990745185,0.0808567666527,0.0200150708955,0.11104741661,0.00818757170337,0.79659030554,0.495948663703,0.0181939017366,0.564393939394,0.108066145967,0.727272727273,-0.0173584483399,0.88,True
weak_innovation,0.5,44,0.0189393939394,0.0400410701441,0.0810988063993,0.0407113808756,0.0327787380114,0.00626469767122,0.334644119595,0.15387428644,0.0140084373206,0.183712121212,0.103652874727,0.590909090909,-0.198755857247,0.88,True
weak_innovation,0.75,44,0.0250568181818,0.0612320434923,0.0814181656663,0.0614687578399,-0.0140977505256,0.00583804044168,0.0791901651637,-0.000188120011818,0.00895259059699,0.032196969697,0.0658231469253,0.568181818182,-0.176321578516,0.88,True
weak_innovation,1,44,0.0301515151515,0.0832420901079,0.0832420901079,0.0832420901079,0,0,0,0,0,0,0,0,0,0.88,True
overconfident,0,50,0,0,0.124001249212,0,0,0,13.297468534,7.20955487781,0.0730558320349,7.26833333333,0.18194106469,1,6.19198146459,1,True
overconfident,0.25,50,0.0308333333333,0.0521561640822,0.125286575002,0.0582480659418,1.31352085727,0.0276209830263,4.86667765447,2.31867942026,0.0434447409033,2.44833333333,0.125985682878,1,1.59034093976,1,True
Expand All @@ -22,5 +22,5 @@ overconfident,1,50,0.07575,0.133489740744,0.133489740744,0.133489740744,0,0,0,0,
underconfident,0,50,0,0,0.122689982655,0,0,0,3.59685262596,7.41181167603,0.0760351134181,7.41166666667,0.172572407492,1,-1.59916957243,1,True
underconfident,0.25,50,0.0161666666667,0.0153343060963,0.124162724625,0.0120737878598,1.04960405099,0.0227025274188,2.59462263478,5.43567667773,0.0652556463509,5.41166666667,0.167994877635,1,-1.55422963494,1,True
underconfident,0.5,50,0.02765,0.0379797971411,0.125361888717,0.0350972105935,0.835869256963,0.0207528356764,1.41654747007,3.03007772993,0.048789975116,2.95333333333,0.137852002536,1,-1.40953147912,1,True
underconfident,0.75,50,0.04395,0.0760228321802,0.127275766639,0.0732942189106,0.279794401894,0.0132801067999,0.400906442563,0.866100585498,0.0337971182139,0.86,0.12248466978,0.84,-0.974361441367,1,True
underconfident,0.75,50,0.04395,0.0760228321802,0.127275766639,0.0732942189106,0.279794401894,0.0132801067999,0.400906442563,0.866100585498,0.0337971182139,0.86,0.12248466978,0.82,-0.974361441367,1,True
underconfident,1,50,0.0745166666667,0.133708863823,0.133708863823,0.133708863823,0,0,0,0,0,0,0,0,0,1,True
6 changes: 3 additions & 3 deletions results/oracle_summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ alpha,repetitions,mean_move_share,mean_nfr,operational_nfr,joint_nfr,baseline_ac
0.3,200,0.019972,0.0360178433364,0.124051722306,0.0361565196259,0.575304,0.000666035989792,0.6088,0.000708937913236,0.587916,0.000669403634686,1.2612,0.0331779547805,3.35029971973,3.3496,0.049794141045,1,1000,0
0.4,200,0.026076,0.050314254323,0.12462105275,0.0501018973576,0.587376,0.000698959111248,0.60961,0.000698117713361,0.596224,0.000679217048516,0.8848,0.0288619100069,2.22567854196,2.2234,0.0413357645041,1,1000,0
0.5,200,0.032846,0.0649130556089,0.125604955768,0.0646613122956,0.596482,0.00070647997123,0.610188,0.00068222462002,0.60207,0.000675988388589,0.5588,0.0293225486494,1.35884915958,1.3706,0.038227541441,0.98,1000,0
0.6,200,0.04073,0.0797496655137,0.126626200997,0.0794229383907,0.603142,0.000693761997044,0.610892,0.000686242174169,0.606136,0.000687838008275,0.2994,0.0275045578681,0.751339848438,0.775,0.0373670507588,0.93,1000,0
0.6,200,0.04073,0.0797496655137,0.126626200997,0.0794229383907,0.603142,0.000693761997044,0.610892,0.000686242174169,0.606136,0.000687838008275,0.2994,0.0275045578681,0.751339848438,0.775,0.0373670507588,0.925,1000,0
0.7,200,0.048592,0.0940754535204,0.128051552541,0.0937360231974,0.607252,0.000691858236271,0.611212,0.000683349186399,0.608786,0.000682392347981,0.1534,0.0236112186945,0.36529035871,0.396,0.0283055830209,0.815,1000,0
0.8,200,0.056732,0.107869842161,0.129754471169,0.10762128478,0.609926,0.000698858092295,0.6114,0.000686507437914,0.610374,0.000679338001736,0.0448,0.0191530414027,0.139798207193,0.1474,0.0231100969906,0.665,1000,0
0.9,200,0.064258,0.120917478786,0.131005951916,0.120609930734,0.611294,0.00070010467272,0.611608,0.000688845571304,0.611392,0.000687981301604,0.0098,0.0113757124687,0.0292674529149,0.0314,0.0158482185166,0.555,1000,0
0.8,200,0.056732,0.107869842161,0.129754471169,0.10762128478,0.609926,0.000698858092295,0.6114,0.000686507437914,0.610374,0.000679338001736,0.0448,0.0191530414027,0.139798207193,0.1474,0.0231100969906,0.66,1000,0
0.9,200,0.064258,0.120917478786,0.131005951916,0.120609930734,0.611294,0.00070010467272,0.611608,0.000688845571304,0.611392,0.000687981301604,0.0098,0.0113757124687,0.0292674529149,0.0314,0.0158482185166,0.525,1000,0
1,200,0.070698,0.132757004413,0.132757004413,0.132757004413,0.611602,0.000699596423504,0.611602,0.000699596423504,0.611602,0.000699596423504,0,0,0,0,0,0,1000,0
Loading
Loading