Arms.Binomial module¶
Binomial distributed arm.
Example of creating an arm:
>>> import random; import numpy as np
>>> random.seed(0); np.random.seed(0)
>>> B03_10 = Binomial(0.3, 10)
>>> B03_10
Bin(0.3, 10)
>>> B03_10.mean
3.0
Examples of sampling from an arm:
>>> B03_10.draw()
3
>>> B03_10.draw_nparray(20)
array([4., 3., 3., 3., 3., 3., 5., 6., 3., 4., 3., 3., 5., 1., 1., 0., 4.,
4., 5., 6.])
-
class
Arms.Binomial.
Binomial
(probability, draws=1)[source]¶ Bases:
Arms.Arm.Arm
Binomial distributed arm.
-
probability
= None¶ Parameter p for this Binomial arm
-
draws
= None¶ Parameter n for this Binomial arm
-
mean
= None¶ Mean for this Binomial arm
-
property
lower_amplitude
¶ (lower, amplitude)
-
oneLR
(mumax, mu)[source]¶ One term of the Lai & Robbins lower bound for Binomial arms: (mumax - mu) / KL(mu, mumax).
-
__module__
= 'Arms.Binomial'¶
-