public static double computeAlpha ( double targetWeight , long targetAgeInSeconds ) { checkArgument ( targetAgeInSeconds > 0 , "targetAgeInSeconds must be > 0" ) ; checkArgument ( targetWeight > 0 && targetWeight < 1 , "targetWeight must be in range (0, 1)" ) ; return - Math . log ( targetWeight ) / targetAgeInSeconds ; }
Compute the alpha decay factor such that the weight of an entry with age targetAgeInSeconds is targetWeight