Skip to main content
aifinhub

Worked example

Running the shipped backtest-overfitting-score engine on the input below produces exactly this output. Continuous integration recomputes it against the engine bundle on every build, so these numbers cannot drift from the code.

Input

{
  "tool": "backtest-overfitting-score",
  "s": 8,
  "max_combos": 500,
  "seed": 42,
  "returns": [
    [
      -0.007607,
      -0.008433,
      0.002527,
      0.009548,
      0.000386,
      -0.003086,
      -0.013818,
      0.003103,
      -0.001452,
      -0.001876,
      -0.009661,
      0.003698,
      -0.008879,
      0.000087,
      0.005411,
      -0.013957,
      -0.016225,
      -0.008241,
      -0.00932,
      -0.005203,
      0.013635,
      -0.01494,
      0.013488,
      0.001743,
      0.001842,
      -0.009871,
      -0.011032,
      -0.003489,
      -0.001506,
      -0.007647,
      -0.003465,
      -0.002703,
      0.001128,
      -0.000813,
      -0.011485,
      0.001114,
      -0.014121,
      -0.007701,
      0.021711,
      -0.008674,
      0.001477,
      -0.023238,
      -0.001341,
      0.003694,
      -0.010272,
      -0.010004,
      0.0139,
      0.003259,
      -0.001892,
      0.002446,
      -0.00491,
      -0.00949,
      0.001046,
      0.010993,
      -0.007657,
      0.002868,
      0.010116,
      -0.015102,
      0.012324,
      0.003874,
      -0.006297,
      -0.007557,
      0.001614,
      0.003874,
      0.005329,
      -0.01097,
      -0.006333,
      -0.011446,
      -0.010086,
      0.023615,
      0.009435,
      0.006638,
      0.011219,
      0.015323,
      0.002509,
      0.01685,
      0.006612,
      0.00075,
      0.005775,
      -0.000548,
      -0.001559,
      -0.006039,
      0.010799,
      0.011098,
      0.000106,
      -0.003287,
      0.018143,
      -0.001286,
      0.013772,
      -0.007472,
      -0.001242,
      -0.012453,
      0.001156,
      -0.003853,
      -0.002835,
      0.002068,
      0.008257,
      -0.002199,
      0.014797,
      -0.00126,
      -0.004281,
      0.014395,
      -0.014099,
      0.013682,
      0.008156,
      -0.003939,
      -0.004044,
      0.001098,
      0.015018,
      0.007361,
      -0.005574,
      -0.008443,
      0.011462,
      0.018576,
      0.007605,
      -0.002427,
      -0.006412,
      -0.021952,
      -0.006747,
      -0.008918,
      -0.00762,
      -0.012725,
      0.010202,
      0.004645,
      0.01703,
      0.000061,
      0.008105,
      -0.003123,
      -0.000806,
      -0.008311,
      -0.003523,
      -0.007899,
      0.002521,
      0.005408,
      0.007466,
      -0.008198,
      0.002437,
      -0.005085,
      0.01975,
      0.00599,
      0.001853,
      0.018434,
      0.00253,
      0.000584,
      0.000106,
      0.003099,
      0.002464,
      0.005883,
      -0.002776,
      -0.011954,
      0.005296,
      -0.005343,
      -0.002491,
      0.017611,
      0.00696,
      0.008335,
      -0.001531,
      -0.003152,
      -0.00285,
      0.005455,
      0.005163,
      -0.005818,
      -0.014524,
      0.006273,
      0.008741,
      0.00559,
      0.007341,
      -0.001281,
      0.018982,
      -0.002406,
      -0.010218,
      -0.005839,
      0.000264,
      -0.002979,
      -0.000778,
      -0.0101,
      0.004605,
      -0.003556,
      -0.001231,
      -0.002957,
      -0.005795,
      -0.009402,
      -0.001695,
      0.000745,
      -0.010244,
      -0.012969,
      -0.005555,
      -0.008597,
      0.006853,
      0.003049,
      0.003559,
      0.003363,
      -0.003207,
      0.001758,
      0.002949,
      -0.001688,
      0.002311,
      0.000368,
      -0.006301,
      0.000936,
      -0.010952,
      0.009508,
      -0.009308,
      -0.00056,
      -0.009114,
      -0.001343,
      0.003215,
      -0.017557,
      -0.006617,
      -0.005486,
      -0.001897,
      -0.009472,
      0.002418,
      0.001107,
      0.01974,
      0.011345,
      0.010953,
      0.006522,
      0.00396,
      0.002117,
      -0.009888,
      0.005347,
      0.012451,
      0.01582,
      0.00519,
      -0.009875,
      -0.002421,
      0.012211,
      -0.01189,
      -0.012948,
      -0.002372,
      -0.013299,
      -0.00759,
      0.003687,
      0.001551,
      -0.003671,
      -0.002077,
      0.004934,
      0.000243,
      -0.010124,
      0.005935,
      -0.011534,
      0.005383,
      0.014001,
      0.01137,
      0.00832,
      0.001503,
      0.006466,
      -0.00883,
      -0.00862,
      -0.006858,
      -0.018451
    ],
    [
      -0.002599,
      -0.01249,
      -0.000768,
      0.014659,
      -0.007903,
      0.001668,
      -0.00597,
      0.006913,
      -0.002515,
      -0.009598,
      0.012531,
      0.022728,
      -0.008417,
      0.003026,
      -0.005167,
      0.0072,
      -0.012631,
      -0.007466,
      -0.006282,
      0.000575,
      -0.005115,
      0.001796,
      0.00165,
      0.004601,
      0.002381,
      0.004698,
      -0.007147,
      0.01338,
      -0.002692,
      0.01626,
      0.004157,
      -0.009184,
      0.003456,
      -0.004427,
      -0.004837,
      0.0042,
      -0.000564,
      0.003732,
      0.002595,
      0.00147,
      -0.003464,
      -0.007321,
      0.007342,
      -0.006111,
      -0.017633,
      -0.016906,
      -0.000206,
      -0.006414,
      0.007947,
      -0.007423,
      -0.006619,
      -0.001341,
      0.008039,
      0.004998,
      0.004973,
      -0.012833,
      -0.014551,
      0.006823,
      -0.002911,
      -0.004485,
      -0.001641,
      0.006185,
      -0.002446,
      0.002514,
      -0.003903,
      -0.00003,
      0.008278,
      -0.010454,
      0.004771,
      0.004374,
      -0.022943,
      -0.010161,
      0.006163,
      -0.004155,
      0.004424,
      -0.009182,
      0.006865,
      -0.011443,
      0.001149,
      -0.006493,
      0.002135,
      -0.010179,
      -0.007789,
      -0.011033,
      -0.005326,
      -0.01244,
      -0.003092,
      -0.00182,
      -0.003007,
      -0.003795,
      -0.00116,
      -0.001842,
      -0.012457,
      -0.021907,
      -0.006275,
      0.008307,
      -0.006231,
      -0.005329,
      0.017913,
      -0.004898,
      0.002562,
      -0.009148,
      -0.007493,
      -0.004149,
      -0.01313,
      -0.001028,
      -0.002185,
      -0.014841,
      0.012308,
      -0.00101,
      -0.001641,
      0.002098,
      0.026443,
      -0.002785,
      -0.005596,
      -0.003746,
      0.000018,
      -0.007626,
      0.006118,
      -0.0022,
      0.018846,
      -0.005512,
      0.011388,
      0.007531,
      -0.004823,
      -0.003043,
      -0.007229,
      0.004015,
      0.009033,
      0.000679,
      0.000818,
      -0.002525,
      -0.008156,
      0.011269,
      -0.009309,
      0.002143,
      -0.001107,
      0.01047,
      0.000274,
      0.005718,
      0.001913,
      0.013187,
      -0.005715,
      0.00549,
      0.012165,
      -0.008927,
      0.012049,
      0.005841,
      -0.00299,
      -0.001533,
      -0.00256,
      0.012738,
      0.001877,
      -0.005116,
      0.010483,
      -0.014202,
      0.008472,
      -0.003035,
      -0.003723,
      0.006801,
      0.019795,
      0.018834,
      -0.002,
      -0.001073,
      0.019896,
      0.001447,
      0.005193,
      -0.005287,
      0.002826,
      -0.005817,
      -0.006516,
      -0.008045,
      0.00054,
      0.002332,
      0.001308,
      -0.012459,
      -0.012143,
      0.00048,
      0.002915,
      0.006755,
      -0.01107,
      -0.005805,
      0.012398,
      -0.001902,
      -0.008612,
      -0.002507,
      0.004902,
      -0.00165,
      -0.009832,
      -0.007272,
      0.00347,
      0.000857,
      0.004866,
      0.003938,
      0.010866,
      -0.008823,
      0.0217,
      0.007548,
      0.010955,
      -0.001893,
      -0.006616,
      -0.013243,
      0.00621,
      0.003595,
      -0.013117,
      -0.008922,
      -0.012827,
      -0.001665,
      -0.007163,
      0.012076,
      -0.000828,
      0.014302,
      -0.003096,
      0.002416,
      0.001582,
      -0.003323,
      0.002436,
      -0.006585,
      0.000963,
      0.00037,
      -0.006513,
      0.003063,
      0.000498,
      0.007974,
      -0.00442,
      0.002107,
      0.00479,
      0.000312,
      -0.006624,
      -0.009057,
      -0.001558,
      -0.015349,
      0.000891,
      0.003371,
      -0.00437,
      0.000723,
      0.006585,
      0.003907,
      -0.019742,
      -0.014603,
      -0.001371,
      -0.01082,
      0.006477,
      -0.001051,
      0.003705,
      -0.005935,
      0.016919,
      0.003175,
      -0.009761,
      0.010011,
      0.006377,
      -0.002754
    ],
    [
      0.003486,
      -0.01331,
      0.001114,
      0.002542,
      0.003635,
      0.014253,
      -0.007912,
      0.019006,
      0.002954,
      -0.00251,
      0.004889,
      -0.006149,
      -0.006969,
      0.005837,
      -0.002009,
      -0.009907,
      -0.01021,
      -0.006779,
      -0.012268,
      0.013655,
      0.011315,
      -0.001646,
      0.003776,
      0.010479,
      -0.001971,
      -0.00643,
      0.002708,
      -0.000718,
      0.020762,
      -0.00495,
      0.002591,
      0.002292,
      -0.002019,
      -0.003038,
      -0.008764,
      0.014829,
      0.001607,
      0.008474,
      0.00003,
      0.004912,
      -0.009748,
      -0.005388,
      -0.019528,
      0.009265,
      -0.009732,
      -0.009528,
      -0.022486,
      0.001387,
      0.000133,
      0.012331,
      -0.001881,
      0.002814,
      0.003454,
      -0.00165,
      0.000802,
      0.012993,
      0.019009,
      -0.005461,
      -0.010639,
      0.026615,
      -0.002979,
      -0.022924,
      -0.003852,
      -0.001726,
      0.014881,
      0.010805,
      0.010043,
      0.014801,
      -0.005783,
      -0.002314,
      0.002512,
      0.005949,
      0.000233,
      0.005222,
      -0.003598,
      0.006489,
      -0.003603,
      -0.004326,
      -0.006227,
      -0.005739,
      0.009195,
      -0.011944,
      -0.012541,
      0.012824,
      -0.006702,
      -0.003601,
      -0.010387,
      0.006808,
      -0.000709,
      0.009398,
      0.003454,
      -0.005537,
      -0.018698,
      0.001332,
      0.000639,
      0.000286,
      0.00154,
      0.000774,
      0.00292,
      0.000921,
      -0.001871,
      0.000798,
      0.001025,
      0.000922,
      0.007591,
      0.013319,
      0.009731,
      -0.001231,
      0.006471,
      -0.003417,
      0.006932,
      0.006744,
      0.013241,
      -0.024821,
      -0.006818,
      0.011626,
      0.00466,
      -0.014313,
      0.003097,
      0.016559,
      0.00463,
      0.021152,
      0.012273,
      0.011978,
      0.010992,
      -0.006009,
      0.012956,
      0.000066,
      -0.002637,
      0.026311,
      0.006168,
      0.011745,
      -0.006737,
      -0.000939,
      0.008149,
      0.000019,
      0.014362,
      -0.021293,
      -0.007537,
      0.005119,
      0.002852,
      0.007819,
      0.001501,
      -0.008867,
      -0.009108,
      -0.010194,
      0.015899,
      -0.00692,
      0.01571,
      -0.003153,
      -0.012947,
      -0.012684,
      0.002476,
      0.009866,
      -0.004376,
      -0.003654,
      0.002282,
      0.010798,
      -0.004496,
      0.008029,
      -0.009739,
      0.008663,
      0.001425,
      -0.007216,
      0.009156,
      -0.004389,
      0.000084,
      -0.006304,
      -0.008008,
      -0.001895,
      -0.002614,
      -0.008904,
      0.008343,
      0.018334,
      0.004495,
      -0.014895,
      0.015643,
      0.010954,
      -0.000684,
      -0.001145,
      -0.014152,
      -0.000439,
      -0.003169,
      0.008985,
      -0.018804,
      0.013682,
      -0.000287,
      0.013181,
      0.000439,
      0.000605,
      0.006022,
      0.004664,
      -0.009431,
      0.003879,
      0.002882,
      -0.009042,
      0.007386,
      -0.01762,
      -0.004178,
      -0.001909,
      0.01808,
      -0.007329,
      -0.012838,
      -0.00906,
      -0.001583,
      -0.006148,
      -0.000189,
      0.011673,
      0.008158,
      0.008813,
      0.002587,
      -0.008601,
      0.022004,
      0.000851,
      -0.003402,
      -0.000193,
      -0.015078,
      0.001615,
      0.006137,
      0.016117,
      -0.002529,
      0.002285,
      -0.009308,
      0.00888,
      0.005664,
      -0.004795,
      0.011285,
      -0.005619,
      -0.003784,
      -0.005674,
      -0.000319,
      -0.017527,
      -0.013529,
      0.011023,
      0.012447,
      -0.023654,
      0.000652,
      -0.005188,
      -0.011734,
      0.002771,
      -0.007129,
      -0.008234,
      -0.006469,
      -0.016879,
      -0.010539,
      -0.001697,
      0.005634,
      -0.008947,
      0.011191,
      -0.000963,
      0.004449,
      0.013423
    ],
    [
      0.008852,
      -0.010706,
      -0.002378,
      0.005423,
      0.004518,
      -0.000613,
      0.000615,
      0.013326,
      0.00759,
      -0.0091,
      -0.004475,
      0.002714,
      -0.004472,
      0.008336,
      -0.002838,
      -0.001532,
      -0.008167,
      -0.005782,
      -0.000678,
      0.010727,
      -0.015255,
      -0.007146,
      0.001326,
      0.018322,
      0.002475,
      -0.001778,
      0.002247,
      -0.01457,
      -0.00048,
      0.002975,
      0.007482,
      0.009793,
      0.005549,
      -0.001337,
      -0.000496,
      0.010937,
      0.008461,
      0.006448,
      -0.005786,
      0.004251,
      -0.013087,
      0.002977,
      0.00819,
      0.000845,
      -0.01503,
      -0.014416,
      -0.000959,
      0.013313,
      -0.005762,
      0.002067,
      0.004587,
      0.022055,
      -0.003401,
      0.001916,
      -0.001477,
      -0.004317,
      -0.019222,
      -0.008712,
      0.013596,
      -0.000347,
      -0.009065,
      -0.000463,
      -0.001257,
      -0.005261,
      0.004553,
      -0.012928,
      -0.010092,
      -0.00059,
      -0.007615,
      0.017119,
      -0.013338,
      -0.006089,
      0.012117,
      0.016367,
      0.002061,
      0.001139,
      -0.017257,
      -0.000665,
      -0.008947,
      0.000609,
      0.021839,
      -0.010826,
      0.002841,
      0.001951,
      -0.003404,
      0.003122,
      0.003013,
      0.015499,
      0.020236,
      -0.007719,
      -0.002011,
      0.003386,
      -0.001359,
      0.012023,
      0.000961,
      0.008937,
      -0.000753,
      -0.028231,
      0.005139,
      -0.001166,
      0.005966,
      -0.011924,
      0.009752,
      0.010457,
      -0.000199,
      -0.016738,
      0.001022,
      0.005433,
      0.003096,
      0.0006,
      0.002228,
      -0.017246,
      -0.011228,
      -0.020622,
      0.009741,
      0.012772,
      0.003404,
      -0.003908,
      -0.008984,
      -0.000814,
      -0.022696,
      -0.001972,
      0.004675,
      -0.000933,
      -0.015595,
      0.001657,
      -0.010628,
      -0.000527,
      -0.009139,
      -0.00587,
      -0.011357,
      0.004861,
      -0.009659,
      -0.015855,
      -0.006604,
      -0.005845,
      -0.002768,
      0.005903,
      -0.00951,
      -0.005424,
      0.000457,
      0.018983,
      0.004286,
      0.013662,
      -0.008631,
      0.003531,
      0.000912,
      -0.018602,
      -0.004687,
      -0.016904,
      0.000894,
      0.00101,
      -0.001467,
      -0.014426,
      -0.00351,
      0.005983,
      -0.013143,
      -0.00345,
      -0.005084,
      0.009319,
      -0.007078,
      -0.006828,
      0.012212,
      -0.006276,
      0.01022,
      -0.01452,
      -0.004641,
      -0.002479,
      -0.002729,
      0.0192,
      0.001188,
      -0.008389,
      0.012928,
      -0.004732,
      0.010695,
      -0.01944,
      -0.003619,
      -0.006542,
      0.002616,
      0.006235,
      -0.014373,
      0.005552,
      -0.007615,
      -0.01575,
      -0.001048,
      0.008588,
      -0.005942,
      -0.0041,
      -0.003245,
      -0.007467,
      0.003649,
      0.001682,
      0.008666,
      0.001958,
      0.000471,
      -0.023063,
      -0.009793,
      -0.000602,
      0.007254,
      0.002173,
      0.010535,
      0.019484,
      0.003534,
      0.013919,
      -0.000796,
      -0.012619,
      0.011209,
      0.001546,
      0.000545,
      -0.00369,
      -0.008794,
      0.007748,
      -0.021979,
      0.00259,
      0.004601,
      0.004005,
      0.006019,
      0.007067,
      0.000473,
      0.01317,
      -0.015218,
      -0.003715,
      -0.0023,
      0.000023,
      -0.000084,
      -0.003739,
      0.005473,
      -0.017922,
      -0.002169,
      -0.000483,
      0.001692,
      -0.020054,
      0.006654,
      -0.001044,
      -0.012923,
      0.015904,
      -0.00658,
      0.006153,
      -0.002146,
      -0.000691,
      -0.010927,
      -0.004342,
      -0.011426,
      0.004418,
      0.003777,
      0.002299,
      -0.005798,
      -0.025346,
      -0.016124,
      -0.024896,
      -0.00642,
      0.002277
    ],
    [
      0.011729,
      -0.005773,
      -0.007699,
      0.006794,
      -0.000552,
      -0.008731,
      0.019041,
      0.033483,
      0.007347,
      -0.000291,
      0.001521,
      0.015613,
      -0.001193,
      0.010122,
      -0.00869,
      -0.019155,
      -0.006399,
      -0.004445,
      0.003505,
      0.004141,
      0.004318,
      0.001827,
      -0.003733,
      0.008366,
      -0.01758,
      -0.007719,
      -0.005996,
      -0.005417,
      0.007886,
      0.011099,
      -0.001841,
      0.021641,
      0.000632,
      -0.009277,
      0.001416,
      0.003799,
      0.008694,
      -0.002379,
      -0.009175,
      -0.002104,
      -0.00056,
      -0.002422,
      -0.01603,
      -0.003501,
      -0.008582,
      -0.008568,
      0.003612,
      0.002075,
      0.012406,
      -0.002588,
      0.015132,
      0.007146,
      -0.001863,
      0.008983,
      0.00495,
      -0.00158,
      0.018503,
      0.010479,
      -0.006045,
      -0.002337,
      0.001861,
      -0.014421,
      0.00303,
      -0.005246,
      -0.003122,
      0.000034,
      -0.014536,
      -0.012657,
      0.016035,
      0.007777,
      0.010025,
      0.017608,
      0.007086,
      -0.001172,
      -0.01303,
      0.001829,
      -0.007165,
      0.009146,
      -0.004829,
      0.005551,
      0.007639,
      -0.000074,
      -0.014306,
      -0.000761,
      -0.013949,
      0.002893,
      0.012667,
      -0.004379,
      -0.004138,
      -0.007296,
      0.004135,
      0.002569,
      0.012599,
      -0.00043,
      0.007188,
      0.017048,
      -0.009827,
      0.010878,
      0.005988,
      -0.003293,
      -0.005724,
      0.00403,
      -0.003844,
      0.009897,
      -0.003228,
      0.003344,
      -0.015898,
      0.004611,
      -0.008967,
      -0.006089,
      -0.010759,
      0.003398,
      -0.015596,
      0.004213,
      0.009417,
      -0.00463,
      0.009835,
      -0.006524,
      0.001871,
      -0.002942,
      0.003756,
      -0.001074,
      0.005464,
      0.002217,
      0.005844,
      -0.0083,
      0.016704,
      0.006948,
      0.011722,
      -0.006093,
      -0.008204,
      -0.007806,
      0.004224,
      -0.010366,
      0.002536,
      0.00412,
      0.016236,
      -0.010085,
      0.002869,
      -0.01268,
      0.001888,
      0.014263,
      -0.017421,
      -0.008968,
      -0.002271,
      -0.000096,
      0.001382,
      0.000378,
      -0.004642,
      -0.002268,
      -0.008866,
      0.005075,
      0.003363,
      0.002907,
      0.011057,
      -0.000787,
      0.014325,
      -0.022647,
      -0.005624,
      0.010579,
      0.000866,
      -0.003546,
      0.022907,
      0.007693,
      0.002303,
      -0.007771,
      -0.005333,
      0.004746,
      0.010793,
      0.003392,
      0.004414,
      -0.006833,
      -0.006227,
      -0.005267,
      0.001398,
      -0.002947,
      -0.004245,
      0.011868,
      0.000303,
      0.001265,
      -0.011969,
      0.01069,
      0.010384,
      0.007087,
      0.003364,
      0.000833,
      0.01531,
      -0.014459,
      0.002397,
      0.014341,
      0.008909,
      0.005115,
      -0.013495,
      0.009696,
      -0.005752,
      -0.013766,
      0.009333,
      0.010953,
      -0.017236,
      -0.013103,
      -0.019697,
      0.009537,
      -0.004786,
      -0.001116,
      0.005204,
      -0.017204,
      0.003276,
      -0.00737,
      -0.009889,
      0.007233,
      0.004274,
      -0.005628,
      0.015721,
      0.004893,
      0.006023,
      -0.007373,
      0.002966,
      -0.002997,
      -0.003431,
      0.01014,
      -0.007883,
      -0.00338,
      -0.004258,
      -0.007795,
      0.017959,
      0.002908,
      0.000229,
      -0.006163,
      -0.000723,
      -0.012504,
      0.005908,
      -0.025767,
      -0.00452,
      0.010136,
      0.001943,
      -0.019074,
      0.008654,
      0.009423,
      0.009538,
      -0.007598,
      -0.01274,
      -0.000106,
      -0.000541,
      0.006797,
      0.011531,
      -0.009658,
      -0.0114,
      -0.007155,
      -0.009824,
      0.002054,
      -0.007449,
      -0.010328
    ],
    [
      0.011256,
      -0.000223,
      0.001441,
      -0.001179,
      -0.012583,
      0.003316,
      0.010388,
      0.01025,
      0.01555,
      -0.002517,
      0.002669,
      0.001067,
      0.002634,
      0.010967,
      0.001981,
      0.00513,
      -0.004714,
      -0.002447,
      0.024113,
      0.001211,
      -0.003333,
      -0.010601,
      -0.008761,
      0.012841,
      0.016576,
      -0.005681,
      -0.010863,
      0.002369,
      0.006501,
      -0.004645,
      -0.006234,
      0.007844,
      0.00037,
      0.000444,
      0.010076,
      0.010562,
      -0.00168,
      -0.006651,
      -0.005482,
      -0.009678,
      0.002108,
      0.002485,
      0.004866,
      0.00583,
      -0.013947,
      -0.01345,
      -0.003561,
      -0.011908,
      -0.004512,
      0.015576,
      0.013835,
      -0.00485,
      0.003579,
      0.009374,
      -0.010021,
      -0.002477,
      0.000416,
      -0.004641,
      0.000633,
      0.006917,
      -0.027076,
      -0.00093,
      0.005321,
      -0.001833,
      0.01852,
      0.008322,
      0.001178,
      -0.020347,
      -0.003362,
      0.004747,
      -0.009566,
      -0.002999,
      -0.024022,
      0.011943,
      0.010809,
      0.005892,
      0.000108,
      0.024052,
      0.001224,
      0.003922,
      0.010204,
      0.004479,
      -0.008172,
      0.010669,
      -0.008238,
      0.007124,
      -0.005708,
      0.001868,
      -0.003056,
      0.011157,
      0.014347,
      0.005166,
      0.005869,
      -0.016238,
      0.006389,
      0.005478,
      0.011501,
      -0.010862,
      0.006021,
      -0.005646,
      0.01212,
      -0.014722,
      -0.016397,
      -0.000976,
      0.003076,
      0.00203,
      -0.002783,
      -0.009184,
      -0.007076,
      0.005028,
      0.004236,
      0.018429,
      0.007052,
      0.018105,
      -0.010309,
      -0.002394,
      0.00331,
      0.000534,
      0.011778,
      0.008003,
      0.006434,
      0.003531,
      0.004997,
      0.00461,
      -0.007504,
      0.001296,
      -0.01234,
      -0.00878,
      0.008247,
      0.007796,
      -0.001149,
      -0.00522,
      0.002953,
      -0.001744,
      -0.000605,
      -0.007237,
      -0.001682,
      0.001705,
      0.020191,
      -0.001263,
      -0.005979,
      0.033385,
      0.003368,
      0.00115,
      0.005386,
      -0.012863,
      0.003545,
      0.009453,
      0.022688,
      -0.006624,
      -0.001311,
      -0.009879,
      -0.001674,
      -0.007016,
      -0.002642,
      -0.020404,
      0.006088,
      0.00398,
      -0.006127,
      0.011828,
      0.010052,
      0.007447,
      0.004753,
      0.008225,
      -0.005209,
      -0.012407,
      -0.000213,
      0.011395,
      0.012609,
      -0.010347,
      0.006798,
      -0.004541,
      -0.004424,
      0.010899,
      0.003831,
      -0.003812,
      0.016229,
      -0.015076,
      0.001982,
      0.00495,
      -0.00768,
      0.013847,
      -0.005161,
      0.006032,
      0.014895,
      -0.00216,
      0.005364,
      0.008787,
      0.000558,
      -0.003571,
      0.004095,
      0.003615,
      0.011424,
      -0.00324,
      -0.005738,
      -0.007359,
      0.016256,
      -0.00762,
      0.002604,
      0.003739,
      0.002564,
      -0.000472,
      -0.006371,
      0.004742,
      0.020126,
      -0.021834,
      -0.002943,
      -0.000946,
      0.001758,
      0.014899,
      -0.011367,
      -0.000837,
      -0.018771,
      0.000841,
      -0.006678,
      -0.00388,
      -0.010419,
      -0.004883,
      -0.005978,
      0.006797,
      -0.00313,
      -0.002307,
      0.004947,
      -0.019637,
      -0.008832,
      -0.014962,
      -0.004709,
      -0.000226,
      0.000391,
      -0.007044,
      -0.003552,
      -0.006143,
      0.007567,
      -0.010228,
      -0.007883,
      0.012963,
      0.005235,
      -0.00732,
      -0.004037,
      -0.014201,
      -0.012702,
      0.003607,
      0.012718,
      0.00157,
      0.000148,
      -0.00375,
      -0.00369,
      -0.002591,
      0.000397,
      -0.000262,
      -0.001766,
      -0.000278
    ],
    [
      0.007631,
      0.004042,
      -0.003391,
      -0.001324,
      0.002492,
      0.003408,
      0.004977,
      0.005391,
      0.009904,
      0.00359,
      -0.013735,
      -0.002114,
      0.006711,
      0.010716,
      -0.009982,
      -0.011107,
      -0.012562,
      -0.018067,
      0.009087,
      -0.009137,
      0.001357,
      0.013068,
      -0.016555,
      0.013036,
      -0.010255,
      0.002186,
      0.006072,
      0.006931,
      -0.00557,
      0.013895,
      -0.011879,
      -0.001353,
      0.008163,
      -0.008732,
      0.007106,
      0.004134,
      -0.012348,
      0.002976,
      0.004026,
      -0.011379,
      0.009395,
      0.001386,
      -0.007777,
      -0.009859,
      -0.020942,
      -0.019683,
      -0.010013,
      0.00459,
      -0.006786,
      0.001025,
      0.006314,
      -0.009702,
      0.003731,
      0.0063,
      0.008087,
      -0.013245,
      0.000883,
      -0.00239,
      0.012924,
      -0.005082,
      -0.001465,
      -0.008386,
      0.003671,
      0.00183,
      0.003836,
      -0.014406,
      -0.004504,
      -0.006225,
      -0.006222,
      0.015315,
      0.000619,
      0.01276,
      0.013281,
      0.017771,
      -0.002314,
      -0.00229,
      0.007379,
      0.010253,
      0.002479,
      -0.002408,
      0.009221,
      0.011061,
      -0.007428,
      0.002185,
      -0.016834,
      0.016038,
      -0.009821,
      0.011365,
      0.005714,
      -0.002801,
      0.001172,
      0.009558,
      -0.009161,
      -0.015026,
      0.014644,
      0.007483,
      -0.012905,
      -0.005553,
      0.00531,
      -0.008305,
      -0.009963,
      0.004821,
      0.000998,
      -0.003496,
      -0.007968,
      -0.002101,
      0.005229,
      -0.000745,
      -0.000517,
      0.01048,
      0.002966,
      -0.001683,
      0.029784,
      0.002484,
      -0.007352,
      0.020163,
      0.010221,
      0.001169,
      -0.004935,
      0.005096,
      -0.000041,
      0.004792,
      0.003576,
      0.006878,
      0.012652,
      -0.020815,
      0.029841,
      0.031106,
      0.002828,
      0.00235,
      0.010255,
      0.00582,
      0.011567,
      0.004781,
      -0.002398,
      0.001545,
      0.016446,
      -0.003486,
      0.001459,
      0.006074,
      -0.000095,
      0.019416,
      -0.007524,
      0.006644,
      -0.012779,
      -0.007376,
      0.017699,
      0.011036,
      -0.006762,
      -0.021686,
      0.004537,
      0.013187,
      0.010867,
      0.010066,
      -0.005867,
      -0.001485,
      -0.00612,
      0.003709,
      -0.0066,
      0.013079,
      -0.006814,
      0.005428,
      -0.002822,
      0.011532,
      -0.001725,
      -0.003191,
      0.008966,
      0.013052,
      0.0041,
      -0.001376,
      0.008191,
      -0.001881,
      0.007918,
      0.007948,
      0.006348,
      -0.003603,
      -0.009235,
      0.000673,
      -0.008589,
      -0.017069,
      -0.002686,
      0.014393,
      0.004456,
      -0.01166,
      0.006483,
      -0.00938,
      -0.003064,
      -0.001005,
      -0.003182,
      0.009465,
      0.011355,
      0.004696,
      -0.017993,
      0.020861,
      -0.016795,
      -0.007922,
      -0.000219,
      -0.009241,
      -0.009295,
      -0.01554,
      0.006853,
      0.000789,
      -0.001668,
      -0.007994,
      0.007739,
      -0.007413,
      0.002101,
      0.00182,
      0.004953,
      0.003292,
      0.00232,
      -0.003627,
      0.012066,
      0.007845,
      0.002976,
      0.008208,
      0.002466,
      0.005215,
      -0.007241,
      0.003357,
      0.000656,
      -0.000032,
      0.009229,
      -0.004244,
      0.006663,
      0.00577,
      0.003643,
      0.010436,
      -0.00003,
      -0.002328,
      -0.002684,
      -0.007725,
      -0.004625,
      0.019142,
      -0.003996,
      -0.017522,
      -0.010835,
      0.004204,
      -0.024369,
      -0.015649,
      -0.011136,
      0.005935,
      -0.001589,
      -0.004825,
      0.001895,
      0.00843,
      -0.000644,
      0.006872,
      -0.010314,
      -0.012681,
      0.002772,
      0.007539
    ],
    [
      0.002048,
      0.005523,
      -0.008066,
      -0.003909,
      0.010556,
      -0.002183,
      0.011698,
      -0.001406,
      0.018,
      0.006978,
      -0.002558,
      0.01189,
      0.010698,
      0.00931,
      -0.001249,
      -0.003277,
      -0.008838,
      -0.013396,
      0.000021,
      -0.009976,
      0.002116,
      -0.005387,
      -0.007579,
      0.00689,
      0.008725,
      -0.012971,
      -0.000674,
      -0.009595,
      0.023219,
      0.008246,
      -0.000345,
      0.001351,
      -0.003896,
      -0.006942,
      0.017163,
      -0.001102,
      -0.008344,
      0.020793,
      0.012062,
      -0.00376,
      0.016507,
      -0.006928,
      0.000304,
      0.006745,
      -0.013109,
      -0.012801,
      0.003163,
      0.025392,
      0.016923,
      0.004972,
      0.000482,
      -0.00692,
      -0.00272,
      -0.016127,
      -0.005475,
      0.011086,
      0.001796,
      -0.008449,
      -0.008578,
      0.001564,
      -0.021133,
      -0.014325,
      -0.000398,
      0.002364,
      -0.002013,
      0.000277,
      -0.010549,
      -0.000514,
      0.0089,
      0.011132,
      -0.015534,
      -0.014591,
      0.008161,
      0.001962,
      0.008913,
      0.022393,
      0.026505,
      -0.002767,
      -0.002542,
      -0.006752,
      0.003652,
      0.019488,
      -0.033398,
      0.007073,
      -0.00783,
      0.015248,
      0.004515,
      0.014988,
      -0.004112,
      -0.010998,
      0.006237,
      0.015724,
      -0.011523,
      -0.002247,
      0.008054,
      0.000407,
      0.006845,
      0.000312,
      0.003805,
      -0.011588,
      0.002502,
      -0.004538,
      0.028605,
      0.010201,
      -0.001033,
      0.011886,
      0.00564,
      0.017292,
      0.005632,
      0.009578,
      -0.015656,
      -0.004341,
      0.024859,
      -0.024528,
      0.017137,
      0.016584,
      0.020839,
      0.006452,
      -0.007646,
      -0.018027,
      0.001231,
      -0.003496,
      0.000994,
      0.009503,
      -0.002081,
      -0.00169,
      0.001376,
      -0.001782,
      0.006596,
      -0.013976,
      -0.008982,
      0.007135,
      0.002409,
      0.003218,
      0.001068,
      -0.003573,
      0.002234,
      -0.00098,
      -0.006153,
      0.008412,
      0.002468,
      0.015212,
      0.001556,
      -0.009053,
      -0.007837,
      0.00353,
      0.028753,
      -0.006503,
      -0.005639,
      -0.003013,
      -0.028265,
      -0.004795,
      -0.012861,
      -0.014399,
      0.002507,
      0.004764,
      0.000413,
      -0.012965,
      -0.007046,
      0.014343,
      -0.004563,
      -0.004432,
      -0.012528,
      0.004261,
      -0.008489,
      0.001216,
      0.017456,
      0.007674,
      -0.001264,
      0.004878,
      0.008573,
      0.000756,
      0.003848,
      0.000074,
      0.008992,
      -0.0025,
      0.009588,
      0.006549,
      0.011056,
      0.023766,
      0.00169,
      0.012332,
      0.004776,
      0.012552,
      0.002776,
      -0.026795,
      0.006117,
      -0.014597,
      0.009576,
      -0.013017,
      0.005232,
      0.006244,
      0.000137,
      0.003258,
      -0.010708,
      -0.002772,
      0.002943,
      0.005565,
      -0.001682,
      0.002634,
      0.004574,
      0.006207,
      -0.014891,
      0.006187,
      0.01193,
      -0.002907,
      0.020392,
      0.00402,
      -0.007208,
      0.004126,
      -0.009064,
      -0.008286,
      -0.016542,
      -0.000151,
      0.012171,
      -0.007094,
      0.017559,
      -0.009326,
      -0.007272,
      0.000138,
      -0.003668,
      -0.017945,
      0.017881,
      0.00225,
      0.00138,
      -0.015835,
      0.008341,
      -0.003081,
      0.009376,
      -0.012552,
      -0.001771,
      -0.008746,
      -0.000842,
      -0.000032,
      -0.004745,
      0.010096,
      0.007954,
      0.016613,
      -0.013507,
      0.000423,
      -0.026589,
      0.019477,
      -0.021889,
      0.002099,
      0.005214,
      -0.003103,
      0.001465,
      -0.003244,
      -0.019464,
      0.005564,
      -0.01604,
      0.009813
    ]
  ],
  "names": [
    "config_1",
    "config_2",
    "config_3",
    "config_4",
    "config_5",
    "config_6",
    "config_7",
    "config_8"
  ]
}

Output

{
  "nStrategies": 8,
  "nObservations": 252,
  "strategies": [
    {
      "name": "config_1",
      "mean": -0.00014709523809523832,
      "stdev": 0.008728914575375354,
      "skew": 0.22978646332924052,
      "excessKurtosis": -0.24675921081442143,
      "sharpe": -0.016851492453620793,
      "sharpeAnnual": -0.26750914951537363,
      "deflatedSharpe": 0
    },
    {
      "name": "config_2",
      "mean": -0.0005446190476190474,
      "stdev": 0.008305875608460642,
      "skew": 0.3228135113067902,
      "excessKurtosis": 0.31862672187373153,
      "sharpe": -0.06557033518107112,
      "sharpeAnnual": -1.0408968016335816,
      "deflatedSharpe": 0
    },
    {
      "name": "config_3",
      "mean": 0.0005191666666666667,
      "stdev": 0.009530329443560111,
      "skew": -0.0025956652067556946,
      "excessKurtosis": -0.09464774073923232,
      "sharpe": 0.05447520673248929,
      "sharpeAnnual": 0.864767097797989,
      "deflatedSharpe": 0
    },
    {
      "name": "config_4",
      "mean": -0.0011744801587301593,
      "stdev": 0.009461868974870277,
      "skew": -0.16356716020109127,
      "excessKurtosis": 0.004403587639469908,
      "sharpe": -0.12412771322974926,
      "sharpeAnnual": -1.970466360102352,
      "deflatedSharpe": 0
    },
    {
      "name": "config_5",
      "mean": 0.00018041666666666664,
      "stdev": 0.009270658328169007,
      "skew": 0.08053285492396697,
      "excessKurtosis": 0.050292071318904785,
      "sharpe": 0.019461041522635822,
      "sharpeAnnual": 0.30893445673917697,
      "deflatedSharpe": 0
    },
    {
      "name": "config_6",
      "mean": 0.0005782063492063491,
      "stdev": 0.009207355077274004,
      "skew": 0.08812505786348983,
      "excessKurtosis": 0.474679120777461,
      "sharpe": 0.06279831117119652,
      "sharpeAnnual": 0.996892284683012,
      "deflatedSharpe": 0
    },
    {
      "name": "config_7",
      "mean": 0.0007336349206349202,
      "stdev": 0.009509599568951558,
      "skew": 0.03992182871002491,
      "excessKurtosis": 0.21896232136928928,
      "sharpe": 0.07714677314386689,
      "sharpeAnnual": 1.2246670571387304,
      "deflatedSharpe": 0
    },
    {
      "name": "config_8",
      "mean": 0.0007877023809523808,
      "stdev": 0.010820871578382713,
      "skew": -0.05415286076547392,
      "excessKurtosis": 0.21856157219047834,
      "sharpe": 0.07279472593741944,
      "sharpeAnnual": 1.1555804495250903,
      "deflatedSharpe": 0
    }
  ],
  "pbo": 0.726,
  "combinationsTested": 500,
  "s": 8,
  "bestStrategyIndex": 6,
  "bestStrategyName": "config_7"
}

Frequently asked questions

What does the Backtest Overfitting Score methodology page document?
CSCV-based PBO and Deflated Sharpe Ratio computation, assumptions, limitations, and references. Source citations, assumption deltas, and as-of dates included. It states the formulas, assumptions, data sources, limitations, and reproducibility steps behind the Backtest Overfitting Score, in the Finance category.
When was the Backtest Overfitting Score methodology last reviewed?
This methodology was last reviewed on 2026-04-20. The matching tool is at https://aifinhub.io/backtest-overfitting-score/.
Are the Backtest Overfitting Score numbers reproducible?
Yes. This page embeds a worked example whose output is the verbatim result of running the shipped backtest-overfitting-score engine on a fixed input; the embedded JSON is recomputed and diffed against the engine in CI, so the numbers cannot drift from the code.

Methodology · Tool · Last updated 2026-04-20

How Backtest Overfitting Score works

How the Backtest Overfitting Score computes PBO and Deflated Sharpe Ratio from a returns CSV.

Scope

The tool answers a specific question: among a basket of candidate strategies you backtested, how likely is the winner's edge to generalize? It does this without requiring new out-of-sample data — it uses combinatorial splits of the observations you already have.

It does not:

  • detect data-mining bias across separate model selection rounds not reflected in the returns table,
  • correct for survivor bias in the universe selection,
  • identify overfit parameters within a single strategy — it compares candidates against each other.

Input format

Wide CSV, one column per candidate strategy, one row per observation (typically daily):

date,strategy_1,strategy_2,strategy_3,...
2020-01-02,0.0012,-0.0005,0.0003,...
2020-01-03,0.0041,0.0009,-0.0002,...

Returns are interpreted as simple returns (not log). The date column is optional. All computation runs client-side in the browser; the file never leaves the device.

Sharpe ratio

For each strategy, daily Sharpe is mean(r) / stdev(r) on the simple-return series. Annualized by √252. No risk-free rate subtracted (assumed effectively zero for the cross-validation window; adjust inputs if material).

Deflated Sharpe Ratio (DSR)

Per Bailey & Lopez de Prado (2014):

DSR = Φ( (SR − E[max SR*]) · √(T − 1) /
            √(1 − γ₃·SR + ((γ₄ − 1)/4)·SR²) )

where:

  • SR = observed per-period Sharpe
  • T = number of observations
  • γ₃ = skewness of returns
  • γ₄ = excess kurtosis of returns
  • E[max SR*] = expected maximum Sharpe under the null of zero true Sharpe across N trials, approximated by (1 − γ)·Φ⁻¹(1 − 1/N) + γ·Φ⁻¹(1 − 1/(N·e)), where γ is Euler–Mascheroni (0.5772…).

DSR returns a probability in [0, 1]. Values above ~95% indicate the observed Sharpe is likely real after correcting for the selection bias (number of strategies tested) and the return distribution's non-normality.

PBO via CSCV

Per Bailey, Borwein, Lopez de Prado & Zhu (2016):

  1. Partition the observation axis into S = 2·s equal chunks.
  2. Enumerate all C(2s, s) ways to choose s chunks as in-sample (IS). The remaining s form out-of-sample (OOS). The tool samples at most 500 combinations for browser-compute bounds.
  3. For each combination:
    1. Compute Sharpe of every candidate over the IS chunks → pick the best (n*).
    2. Compute Sharpe of every candidate over the OOS chunks.
    3. Find n*'s fractional rank r ∈ [0, 1] in OOS Sharpes.
    4. Compute logit λ = log(r / (1 − r)).
  4. PBO = fraction of combinations where λ < 0 — i.e. the IS-best ranks below median OOS.

Intuition: if the IS-best is genuinely good, it should tend to rank above median OOS. A PBO near 0.5 means OOS rank is a coin flip — the IS-best was probably lucky. Near 0.0 = robust. Above 0.5 = worse than random (negative selection).

Parameter: S

S (user-configurable 4–16) controls partition count. Higher S = finer cross-validation but more combinations. Default: 8 → 2S = 16 chunks, C(16, 8) = 12,870 combinations — sampled to 500.

Verdict bands

PBOVerdict
< 20%Low overfitting risk — edge appears to generalize
20–50%Moderate overfitting risk — further OOS testing advised
≥ 50%High overfitting risk — classic signature of a lucky fit

Assumptions + limitations

  1. Independent observations within chunks. The tool does not account for autocorrelation inside a chunk. Heavily serial-correlated returns will have inflated Sharpe and under-sampled variance.
  2. Stationary across chunks. Structural breaks (regime change) can either make PBO look better or worse than reality. Inspect a rolling Sharpe plot of each strategy externally.
  3. Equal chunk size. The last chunk absorbs any remainder when T is not divisible by 2S.
  4. Sampling for large S. Combinations are capped at 500 via random shuffle; PBO is a Monte Carlo estimate with convergence error roughly 1/√500 ≈ 4.5pp.
  5. No transaction costs. The tool uses the returns you provide; if they are gross, conclusions apply to gross Sharpe.
  6. DSR E[max] is an approximation. Bailey-Lopez de Prado give a tight asymptotic form; with N < 10 the approximation error grows.

Reproducibility

Source at src/components/tools/backtest-overfitting/BacktestOverfitting.tsx in the aifinhub repository. All math is client-side JavaScript. The same CSV + same S parameter will yield the same Sharpe and DSR values deterministically; PBO will vary run-to-run within a few percentage points due to sampling. Run 3–5 times for tighter bounds.

References

  • Bailey, D. H., & Lopez de Prado, M. (2014). "The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting, and Non-Normality." Journal of Portfolio Management 40(5), 94–107.
  • Bailey, D. H., Borwein, J., Lopez de Prado, M., & Zhu, Q. J. (2016). "The Probability of Backtest Overfitting." Journal of Computational Finance 20(4), 39–70.
  • Harvey, C. R., & Liu, Y. (2015). "Backtesting." Journal of Portfolio Management 41(4), 13–28.
  • White, H. (2000). "A Reality Check for Data Snooping." Econometrica 68(5), 1097–1126.
  • Mertens, E. (2002). "Variance of the IID estimator in Lo (2002)." Working paper.

External resources

Changelog

  • 2026-04-20 — Initial release. PBO via CSCV with 500-combination sampling cap. DSR with Bailey-Lopez de Prado E[max SR*] approximation.
Planning estimates only — not financial, tax, or investment advice.