Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace quantile functions #10

Open
lawmurray opened this issue Feb 15, 2021 · 1 comment
Open

Replace quantile functions #10

lawmurray opened this issue Feb 15, 2021 · 1 comment
Labels
help wanted startup project Ideal project for new contributors

Comments

@lawmurray
Copy link
Owner

We recently replaced cdf functions from Boost Math with our own implementations. The aim is to do so for quantile functions too. This will allow us to integrate them with the Expression hierarchy and the various features that it provides, such as automatic differentiation, as well as future accelerator support.

As part of upgrading to C++17, we also replaced the use of the Boost FileSystem library with its new STL equivalent. Quantile functions are the last remaining use of Boost, and will allow us to eliminate it as a dependency. That may have the added side effect of improving build times given the complexity of some Boost code. Generally, though, eliminating dependencies simplifies maintenance, too.

There are two steps:

  1. Augment the test suite with a new set of tests for the quantile functions. See the cdf tests as a starting point. A simple test paradigm would be to repeatedly draw random samples x from the distribution, evaluate y = quantile(cdf(x)), and check that abs(x - y) < ε.
  2. Once the tests are implemented such that all the current Boost-based quantile functions are passing, reimplement them in pure Birch. The quantile functions are found in quantile.birch. Currently most of them use nested C++ code to call Boost functions. The aim is to replace this with pure Birch implementations, as has been done in cdf.birch.

Implementing the quantile functions may involve implementing some special functions, which may have standard approximations based on Taylor expansions or similar. This is part of the fun and a good learning experience. The existing implementations in Boost Math, or in a numerical library such as NumPy, may provide a good reference.

@lawmurray lawmurray added help wanted startup project Ideal project for new contributors labels Feb 15, 2021
@RigvedRocks
Copy link

I am willing to work on this issue. Can you please assign this issue to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted startup project Ideal project for new contributors
Projects
None yet
Development

No branches or pull requests

2 participants