You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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) < ε.
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.
The text was updated successfully, but these errors were encountered:
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:
x
from the distribution, evaluatey = quantile(cdf(x))
, and check thatabs(x - y) < ε
.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.
The text was updated successfully, but these errors were encountered: