def oneLR(mumax, mu): """ One term of the Lai & Robbins lower bound for DiscreteArm arms: (mumax - mu) / KL(mu, mumax). .. warning:: FIXME this is not correctly defined, except for the special case of having **only** 2 values, a ``DiscreteArm`` is NOT a one-dimensional distribution, and so the kl between two distributions is NOT a function of their mean! """ print( "WARNING: DiscreteArm.oneLR({:.3g}, {:.3g}) is not defined, klBern is used but this is WRONG." .format(mumax, mu)) # DEBUG return (mumax - mu) / klBern(mu, mumax)
def kl(x, y): """ The kl(x, y) to use for this arm. .. warning:: FIXME this is not correctly defined, except for the special case of having **only** 2 values, a ``DiscreteArm`` is NOT a one-dimensional distribution, and so the kl between two distributions is NOT a function of their mean! """ print( "WARNING: DiscreteArm.kl({:.3g}, {:.3g}) is not defined, klBern is used but this is WRONG." .format(x, y)) # DEBUG return klBern(x, y)
def kl(x, y): """ The kl(x, y) to use for this arm.""" return klBern(x, y)
def oneLR(mumax, mu): """ One term of the Lai & Robbins lower bound for UniformArm arms: (mumax - mu) / KL(mu, mumax). """ return (mumax - mu) / klBern(mu, mumax)