fasiha / ebisu.js

JavaScript port of Ebisu, the public-domain library for Bayesian quiz scheduling.
The Unlicense
45 stars 7 forks source link

v2.1.3: tolerance to allow extreme unbalance to converge #25

Closed fasiha closed 8 months ago

fasiha commented 8 months ago

See https://github.com/fasiha/ebisu.js/issues/20#issuecomment-1989133935

ebisu.updateRecall([4, 4, 1e9], 1, 1, 1.5) throws because minimize-golden-section-1d can't converge but this PR allows you a backdoor: you can call ebisu.updateRecall([4, 4, 1e9], 1, 1, 1.5, undefined, undefined, undefined, {tolerance: 1e-6}) and this converges because the tolerance is relaxed. The default is 1e-8.

I decided to let this be a backdoor configuration for advanced users rather than tweak the default. 1e-8 is minimize-golden-section-1d's default and I'm not really sure what the impact will be on various users if I tweak this, especially to lower it. I doubt that α and β that is 1e-6 vs 1e-8 apart matters to many people, but I'd prefer to be safe for now.