TruncatedExponential#

class statrl.settings.bandits.stochastic.anytime.envs.distributions.TruncatedExponential(p, trunc)[source]#

Bases: object

Exponential arm clipped at trunc, with mass piling on the boundary.

Kept custom rather than delegating to scipy.stats.truncexpon, which renormalizes the tail instead of clipping it and therefore describes a different distribution.

Parameters:
  • p (float) – Rate of the underlying exponential.

  • trunc (float) – Value at which samples are clipped.

mean#

True mean of the clipped variable, \((1 - e^{-p\,\mathrm{trunc}})/p\).

Type:

float

variance#

Placeholder, left at 0; not used for regret accounting.

Type:

float

Methods

__init__(p, trunc)

sample()

Draw one reward, clipped at trunc.

sample()[source]#

Draw one reward, clipped at trunc.

Returns:

An exponential draw, capped above by trunc.

Return type:

float