Skip to contents

Calculates the allocation ratio for a two-point stable-variance bandit, given the empirical mean and the discount parameter alpha.

Usage

twopoint_stable_var_ratio(A, e, alpha)

Arguments

A

Integer. Size of the experiment. Must be a positive integer.

e

Numeric. Empirical mean. Must be a numeric value.

alpha

Numeric. Discount parameter.

Value

Numeric vector. Allocation ratio lambda.

Examples

# Calculate the allocation ratio for a two-point stable-variance bandit with e=0.1 and alpha=0.5
twopoint_stable_var_ratio(1000, 0.1, 0.5)
#>    [1] 0.014558864 0.010511619 0.008708974 0.007632242 0.006896888 0.006354006
#>    [7] 0.005932187 0.005592346 0.005311050 0.005073284 0.004868925 0.004690864
#>   [13] 0.004533946 0.004394326 0.004269071 0.004155902 0.004053013 0.003958958
#>   [19] 0.003872557 0.003792841 0.003719004 0.003650370 0.003586367 0.003526508
#>   [25] 0.003470373 0.003417600 0.003367874 0.003320922 0.003276502 0.003234400
#>   [31] 0.003194428 0.003156418 0.003120220 0.003085700 0.003052737 0.003021221
#>   [37] 0.002991055 0.002962149 0.002934420 0.002907797 0.002882209 0.002857596
#>   [43] 0.002833900 0.002811069 0.002789054 0.002767810 0.002747298 0.002727477
#>   [49] 0.002708313 0.002689773 0.002671826 0.002654442 0.002637597 0.002621264
#>   [55] 0.002605420 0.002590043 0.002575112 0.002560609 0.002546515 0.002532813
#>   [61] 0.002519487 0.002506522 0.002493903 0.002481617 0.002469650 0.002457992
#>   [67] 0.002446630 0.002435553 0.002424751 0.002414215 0.002403934 0.002393901
#>   [73] 0.002384106 0.002374542 0.002365200 0.002356074 0.002347157 0.002338441
#>   [79] 0.002329921 0.002321590 0.002313443 0.002305474 0.002297678 0.002290050
#>   [85] 0.002282584 0.002275276 0.002268121 0.002261116 0.002254256 0.002247537
#>   [91] 0.002240955 0.002234506 0.002228188 0.002221996 0.002215927 0.002209978
#>   [97] 0.002204147 0.002198429 0.002192823 0.002187325 0.002181933 0.002176645
#>  [103] 0.002171457 0.002166368 0.002161375 0.002156476 0.002151669 0.002146952
#>  [109] 0.002142322 0.002137778 0.002133318 0.002128940 0.002124643 0.002120424
#>  [115] 0.002116282 0.002112215 0.002108222 0.002104301 0.002100452 0.002096671
#>  [121] 0.002092959 0.002089313 0.002085732 0.002082216 0.002078763 0.002075371
#>  [127] 0.002072040 0.002068768 0.002065554 0.002062398 0.002059297 0.002056252
#>  [133] 0.002053262 0.002050324 0.002047439 0.002044605 0.002041821 0.002039087
#>  [139] 0.002036402 0.002033765 0.002031175 0.002028632 0.002026134 0.002023681
#>  [145] 0.002021273 0.002018908 0.002016585 0.002014305 0.002012066 0.002009869
#>  [151] 0.002007711 0.002005593 0.002003514 0.002001474 0.001999471 0.001997506
#>  [157] 0.001995578 0.001993685 0.001991829 0.001990008 0.001988222 0.001986470
#>  [163] 0.001984751 0.001983067 0.001981415 0.001979795 0.001978208 0.001976652
#>  [169] 0.001975127 0.001973634 0.001972170 0.001970737 0.001969333 0.001967959
#>  [175] 0.001966613 0.001965297 0.001964008 0.001962747 0.001961514 0.001960308
#>  [181] 0.001959129 0.001957976 0.001956850 0.001955750 0.001954675 0.001953626
#>  [187] 0.001952602 0.001951603 0.001950628 0.001949678 0.001948752 0.001947850
#>  [193] 0.001946971 0.001946115 0.001945283 0.001944473 0.001943686 0.001942921
#>  [199] 0.001942179 0.001941458 0.001940759 0.001940082 0.001939426 0.001938790
#>  [205] 0.001938176 0.001937583 0.001937010 0.001936457 0.001935925 0.001935412
#>  [211] 0.001934920 0.001934447 0.001933993 0.001933558 0.001933143 0.001932747
#>  [217] 0.001932369 0.001932010 0.001931670 0.001931348 0.001931044 0.001930758
#>  [223] 0.001930490 0.001930239 0.001930007 0.001929792 0.001929594 0.001929413
#>  [229] 0.001929250 0.001929103 0.001928974 0.001928861 0.001928764 0.001928684
#>  [235] 0.001928621 0.001928574 0.001928543 0.001928528 0.001928529 0.001928545
#>  [241] 0.001928578 0.001928626 0.001928690 0.001928769 0.001928863 0.001928973
#>  [247] 0.001929098 0.001929238 0.001929393 0.001929563 0.001929748 0.001929947
#>  [253] 0.001930161 0.001930390 0.001930633 0.001930891 0.001931162 0.001931449
#>  [259] 0.001931749 0.001932063 0.001932392 0.001932734 0.001933091 0.001933461
#>  [265] 0.001933845 0.001934243 0.001934654 0.001935079 0.001935518 0.001935970
#>  [271] 0.001936435 0.001936914 0.001937406 0.001937911 0.001938429 0.001938961
#>  [277] 0.001939506 0.001940064 0.001940634 0.001941218 0.001941814 0.001942424
#>  [283] 0.001943046 0.001943681 0.001944329 0.001944989 0.001945662 0.001946348
#>  [289] 0.001947046 0.001947756 0.001948479 0.001949215 0.001949963 0.001950723
#>  [295] 0.001951496 0.001952281 0.001953078 0.001953887 0.001954709 0.001955543
#>  [301] 0.001956388 0.001957247 0.001958117 0.001958999 0.001959893 0.001960799
#>  [307] 0.001961717 0.001962647 0.001963589 0.001964543 0.001965509 0.001966487
#>  [313] 0.001967477 0.001968478 0.001969491 0.001970516 0.001971553 0.001972601
#>  [319] 0.001973661 0.001974733 0.001975817 0.001976912 0.001978019 0.001979138
#>  [325] 0.001980268 0.001981410 0.001982564 0.001983729 0.001984906 0.001986094
#>  [331] 0.001987294 0.001988505 0.001989728 0.001990963 0.001992209 0.001993467
#>  [337] 0.001994736 0.001996017 0.001997309 0.001998613 0.001999928 0.002001255
#>  [343] 0.002002594 0.002003944 0.002005305 0.002006678 0.002008062 0.002009458
#>  [349] 0.002010866 0.002012285 0.002013715 0.002015157 0.002016611 0.002018076
#>  [355] 0.002019552 0.002021040 0.002022540 0.002024051 0.002025574 0.002027108
#>  [361] 0.002028654 0.002030211 0.002031780 0.002033361 0.002034953 0.002036557
#>  [367] 0.002038172 0.002039799 0.002041438 0.002043088 0.002044750 0.002046424
#>  [373] 0.002048109 0.002049806 0.002051515 0.002053235 0.002054967 0.002056711
#>  [379] 0.002058467 0.002060234 0.002062014 0.002063805 0.002065608 0.002067422
#>  [385] 0.002069249 0.002071088 0.002072938 0.002074801 0.002076675 0.002078561
#>  [391] 0.002080460 0.002082370 0.002084292 0.002086227 0.002088174 0.002090132
#>  [397] 0.002092103 0.002094086 0.002096081 0.002098088 0.002100108 0.002102140
#>  [403] 0.002104184 0.002106241 0.002108309 0.002110391 0.002112484 0.002114590
#>  [409] 0.002116709 0.002118840 0.002120983 0.002123139 0.002125308 0.002127489
#>  [415] 0.002129683 0.002131890 0.002134109 0.002136342 0.002138587 0.002140844
#>  [421] 0.002143115 0.002145398 0.002147695 0.002150004 0.002152327 0.002154662
#>  [427] 0.002157011 0.002159373 0.002161748 0.002164136 0.002166537 0.002168952
#>  [433] 0.002171380 0.002173821 0.002176276 0.002178744 0.002181226 0.002183721
#>  [439] 0.002186230 0.002188753 0.002191289 0.002193839 0.002196403 0.002198980
#>  [445] 0.002201572 0.002204177 0.002206797 0.002209430 0.002212078 0.002214740
#>  [451] 0.002217415 0.002220106 0.002222810 0.002225529 0.002228262 0.002231010
#>  [457] 0.002233772 0.002236548 0.002239340 0.002242146 0.002244966 0.002247802
#>  [463] 0.002250652 0.002253518 0.002256398 0.002259293 0.002262204 0.002265129
#>  [469] 0.002268070 0.002271026 0.002273998 0.002276984 0.002279987 0.002283005
#>  [475] 0.002286038 0.002289087 0.002292152 0.002295233 0.002298330 0.002301442
#>  [481] 0.002304571 0.002307716 0.002310877 0.002314054 0.002317247 0.002320457
#>  [487] 0.002323683 0.002326926 0.002330186 0.002333462 0.002336755 0.002340065
#>  [493] 0.002343392 0.002346735 0.002350096 0.002353474 0.002356870 0.002360282
#>  [499] 0.002363712 0.002367160 0.002370625 0.002374108 0.002377609 0.002381127
#>  [505] 0.002384664 0.002388219 0.002391791 0.002395382 0.002398991 0.002402619
#>  [511] 0.002406265 0.002409930 0.002413613 0.002417316 0.002421037 0.002424777
#>  [517] 0.002428536 0.002432315 0.002436112 0.002439930 0.002443766 0.002447622
#>  [523] 0.002451498 0.002455394 0.002459310 0.002463246 0.002467202 0.002471178
#>  [529] 0.002475174 0.002479191 0.002483229 0.002487287 0.002491366 0.002495466
#>  [535] 0.002499588 0.002503730 0.002507894 0.002512079 0.002516285 0.002520514
#>  [541] 0.002524764 0.002529036 0.002533330 0.002537646 0.002541985 0.002546346
#>  [547] 0.002550730 0.002555136 0.002559565 0.002564017 0.002568493 0.002572991
#>  [553] 0.002577513 0.002582059 0.002586628 0.002591221 0.002595838 0.002600479
#>  [559] 0.002605145 0.002609835 0.002614549 0.002619288 0.002624052 0.002628841
#>  [565] 0.002633656 0.002638495 0.002643361 0.002648252 0.002653168 0.002658111
#>  [571] 0.002663080 0.002668075 0.002673097 0.002678146 0.002683221 0.002688324
#>  [577] 0.002693453 0.002698610 0.002703795 0.002709007 0.002714248 0.002719516
#>  [583] 0.002724813 0.002730138 0.002735492 0.002740875 0.002746287 0.002751729
#>  [589] 0.002757200 0.002762700 0.002768231 0.002773791 0.002779382 0.002785004
#>  [595] 0.002790656 0.002796339 0.002802053 0.002807799 0.002813576 0.002819385
#>  [601] 0.002825227 0.002831100 0.002837006 0.002842945 0.002848917 0.002854922
#>  [607] 0.002860960 0.002867033 0.002873139 0.002879279 0.002885454 0.002891664
#>  [613] 0.002897908 0.002904188 0.002910503 0.002916854 0.002923241 0.002929665
#>  [619] 0.002936125 0.002942621 0.002949155 0.002955727 0.002962336 0.002968982
#>  [625] 0.002975668 0.002982392 0.002989154 0.002995956 0.003002797 0.003009678
#>  [631] 0.003016599 0.003023561 0.003030563 0.003037607 0.003044691 0.003051818
#>  [637] 0.003058986 0.003066197 0.003073450 0.003080747 0.003088087 0.003095470
#>  [643] 0.003102898 0.003110370 0.003117887 0.003125449 0.003133057 0.003140711
#>  [649] 0.003148411 0.003156157 0.003163951 0.003171793 0.003179682 0.003187619
#>  [655] 0.003195605 0.003203641 0.003211725 0.003219860 0.003228045 0.003236281
#>  [661] 0.003244568 0.003252907 0.003261298 0.003269742 0.003278239 0.003286789
#>  [667] 0.003295393 0.003304052 0.003312765 0.003321534 0.003330359 0.003339240
#>  [673] 0.003348179 0.003357174 0.003366228 0.003375340 0.003384511 0.003393742
#>  [679] 0.003403033 0.003412384 0.003421797 0.003431272 0.003440808 0.003450408
#>  [685] 0.003460071 0.003469799 0.003479591 0.003489448 0.003499372 0.003509361
#>  [691] 0.003519419 0.003529543 0.003539737 0.003549999 0.003560332 0.003570735
#>  [697] 0.003581209 0.003591755 0.003602373 0.003613065 0.003623831 0.003634672
#>  [703] 0.003645588 0.003656580 0.003667649 0.003678797 0.003690022 0.003701327
#>  [709] 0.003712713 0.003724179 0.003735727 0.003747358 0.003759072 0.003770870
#>  [715] 0.003782754 0.003794724 0.003806781 0.003818926 0.003831160 0.003843483
#>  [721] 0.003855898 0.003868404 0.003881002 0.003893695 0.003906482 0.003919365
#>  [727] 0.003932345 0.003945422 0.003958599 0.003971875 0.003985253 0.003998732
#>  [733] 0.004012315 0.004026003 0.004039796 0.004053696 0.004067704 0.004081822
#>  [739] 0.004096050 0.004110389 0.004124842 0.004139409 0.004154092 0.004168891
#>  [745] 0.004183810 0.004198848 0.004214007 0.004229288 0.004244694 0.004260225
#>  [751] 0.004275883 0.004291670 0.004307587 0.004323636 0.004339817 0.004356134
#>  [757] 0.004372587 0.004389179 0.004405910 0.004422783 0.004439799 0.004456961
#>  [763] 0.004474269 0.004491727 0.004509335 0.004527095 0.004545011 0.004563083
#>  [769] 0.004581313 0.004599704 0.004618258 0.004636977 0.004655863 0.004674918
#>  [775] 0.004694145 0.004713545 0.004733121 0.004752876 0.004772812 0.004792930
#>  [781] 0.004813235 0.004833728 0.004854411 0.004875289 0.004896362 0.004917634
#>  [787] 0.004939108 0.004960787 0.004982672 0.005004769 0.005027078 0.005049604
#>  [793] 0.005072349 0.005095318 0.005118512 0.005141935 0.005165590 0.005189482
#>  [799] 0.005213613 0.005237988 0.005262609 0.005287480 0.005312606 0.005337989
#>  [805] 0.005363635 0.005389546 0.005415728 0.005442184 0.005468918 0.005495936
#>  [811] 0.005523241 0.005550838 0.005578731 0.005606926 0.005635427 0.005664239
#>  [817] 0.005693367 0.005722817 0.005752594 0.005782702 0.005813148 0.005843938
#>  [823] 0.005875076 0.005906569 0.005938424 0.005970645 0.006003240 0.006036215
#>  [829] 0.006069577 0.006103332 0.006137487 0.006172050 0.006207027 0.006242426
#>  [835] 0.006278255 0.006314521 0.006351233 0.006388399 0.006426027 0.006464125
#>  [841] 0.006502703 0.006541769 0.006581333 0.006621405 0.006661993 0.006703109
#>  [847] 0.006744762 0.006786962 0.006829722 0.006873051 0.006916961 0.006961464
#>  [853] 0.007006571 0.007052296 0.007098651 0.007145648 0.007193301 0.007241625
#>  [859] 0.007290633 0.007340339 0.007390759 0.007441908 0.007493801 0.007546456
#>  [865] 0.007599889 0.007654117 0.007709157 0.007765030 0.007821752 0.007879344
#>  [871] 0.007937826 0.007997218 0.008057542 0.008118819 0.008181073 0.008244327
#>  [877] 0.008308605 0.008373931 0.008440333 0.008507836 0.008576467 0.008646257
#>  [883] 0.008717233 0.008789426 0.008862867 0.008937590 0.009013628 0.009091016
#>  [889] 0.009169790 0.009249987 0.009331647 0.009414809 0.009499515 0.009585808
#>  [895] 0.009673734 0.009763339 0.009854672 0.009947782 0.010042722 0.010139546
#>  [901] 0.010238312 0.010339077 0.010441903 0.010546854 0.010653995 0.010763397
#>  [907] 0.010875131 0.010989273 0.011105900 0.011225096 0.011346945 0.011471537
#>  [913] 0.011598965 0.011729328 0.011862727 0.011999271 0.012139070 0.012282243
#>  [919] 0.012428913 0.012579209 0.012733268 0.012891233 0.013053254 0.013219488
#>  [925] 0.013390102 0.013565271 0.013745180 0.013930024 0.014120008 0.014315349
#>  [931] 0.014516278 0.014723036 0.014935881 0.015155086 0.015380939 0.015613748
#>  [937] 0.015853839 0.016101557 0.016357273 0.016621380 0.016894297 0.017176472
#>  [943] 0.017468384 0.017770545 0.018083505 0.018407852 0.018744219 0.019093287
#>  [949] 0.019455788 0.019832512 0.020224313 0.020632114 0.021056914 0.021499799
#>  [955] 0.021961949 0.022444646 0.022949294 0.023477422 0.024030708 0.024610993
#>  [961] 0.025220302 0.025860867 0.026535156 0.027245904 0.027996148 0.028789273
#>  [967] 0.029629065 0.030519764 0.031466143 0.032473592 0.033548217 0.034696966
#>  [973] 0.035927783 0.037249785 0.038673495 0.040211117 0.041876890 0.043687530
#>  [979] 0.045662792 0.047826192 0.050205953 0.052836237 0.055758797 0.059025213
#>  [985] 0.062699959 0.066864702 0.071624443 0.077116491 0.083523926 0.091096405
#>  [991] 0.100183448 0.111289923 0.125173137 0.143023161 0.166823472 0.200144404
#>  [997] 0.250126824 0.333433467 0.500056285 1.000000000