Skip to content

Generalized formula implementation

Latest

Choose a tag to compare

@victordavis victordavis released this 22 Oct 02:44
· 30 commits to master since this release

Generalized formula_n(n, x) to replace individual hard-coded formula_5(x) functions for n = 0 -> 5. Keeping unused legacy functions because they're documented in the original paper and a unit test verifies the new matches the old.

Advantages:

  • Can calculate n-legomena k-vector for arbitrarily high n rather than limited at n<6
  • Generalized formula can be evaluated at x=0, x=1, removing the troublesome singularities
  • No noticeable loss of speed or accuracy

Disadvantages:

  • LogModel.options, .epsilon, .dimension are all deprecated. LogModel.predict_k() now takes a mandatory dim argument. Best is to pass dim = corpus.dimension so shape of predictions matches shape of realizations.
  • New dependency mpmath to serve third party implementation of lerchphi(). Necessary also for future support of zeta() and polylog() to onboard competing models.