Arm#

class statrl.settings.bandits.stochastic.anytime.envs.distributions.Arm(dist)[source]#

Bases: object

One bandit arm, adapting a frozen scipy.stats distribution.

Parameters:

dist (scipy.stats frozen distribution) – Any object exposing mean() and rvs().

mean#

True mean of the arm, used for regret accounting only.

Type:

float

Examples

>>> from scipy.stats import bernoulli
>>> arm = Arm(bernoulli(0.3))
>>> float(arm.mean)
0.3

Methods

__init__(dist)

sample()

Draw one independent reward.

sample()[source]#

Draw one independent reward.

Returns:

A sample from the underlying distribution.

Return type:

float