class DecayedBetaBinomial ( BetaBinomial ): def __init__ ( self , eps , a0 = 1. , b0 = 1. ): super ( DecayedBetaBinomial , self ) . __init__ ( a0 = a0 , b0 = b0 ) self . eps = eps self . a0 = a0 self . b0 = b0 def update ( self , n , x ): super ( DecayedBetaBinomial , self ) . update ( n , x ) self . a = ( 1 - self . eps ) * self . a + self . eps * self . a0 self . b = ( 1 - self . eps ) * self . b + self . eps * self . b0