fasiha / ebisu

Public-domain Python library for flashcard quiz scheduling using Bayesian statistics. (JavaScript, Java, Dart, and other ports available!)
https://fasiha.github.io/ebisu
The Unlicense
308 stars 32 forks source link

Simpler expression for predictRecall when b is integer #17

Closed fasiha closed 1 year ago

fasiha commented 4 years ago

Interesting factoid:

Beta[a+t, b] / Beta[a, b] = prod(map(lambda m: (a+m)/(a+t+m), range(b)))

for b>=2 integer (and a and t arbitrary), at least for b>=2 and b<=6.

(Apologies for mixing Mathematica and Python notation.)

This might be immediately useful if predictRecall checks for b (small?) integer.

This can be even more useful if we can find a way to make b always integer in our Ebisu models—easy to do when a quiz is a success, but a bit harder to do when a quiz is a failure: basically we have to search t' (t-prime in the readme) that makes b an integer.

Then, predicting recall at any given time is a rational polynomial, very fast to calculate, no need for Gamma or Beta functions. We could always try to make b=2 even.

(One question I have is, right now with version 1.0, we rebalance the model to roughly near the half-life so a and b aren't too different. Are there t's that yield Beta distributions that are more faithful to the GB1 posterior than others?)

fasiha commented 4 years ago
fasiha commented 1 year ago

Closed this because Ebisu v3 is moving away from Beta priors on recall to Gamma priors on half-life.