Add icdf for Wald distribution#8357
Conversation
Documentation build overview
16 files changed ·
|
|
Hi, I've been researching the Wald ICDF implementation and found that unlike many other distributions it has no closed-form quantile function. The most reliable approach appears to be a Newton's method iteration started from the mode of the distribution, as described in Giner & Smyth (2016) "statmod: Probability Calculations for the Inverse Gaussian Distribution" https://arxiv.org/abs/1603.06687. This guarantees monotonic convergence for all parameter values. Before proceeding I wanted to check, is the preferred approach to implement this as a proper Newton iteration using |
|
@TalenMud sorry for the delay and thanks for the initiative. Yes we've ran out of closed form solutions. You can check how #8339 does a binary search for discrete variables. For continuous you'll likely need something like you said. If you want to look at an implementation boost has one here: https://github.com/boostorg/math/blob/8ee12a5355935cbaac5d5338372d0d0e3311b473/include/boost/math/distributions/inverse_gaussian.hpp#L343-L402 They are usually not how you'd write in PyMC/PyTensor but can be helpful as a reference. Feel free to take a stab. Note PyTensor has a minimize/root Ops that we can use if that's simpler than rolling a custom Scan |
|
Thanks for the pointers! I'll take a look at the Boost implementation and #8339 for the pattern. I'll also check out the PyTensor root Ops as the approach, it sounds better than rolling a custom Scan. |
Description
Adds
icdf(inverse CDF / quantile function) for the Wald (Inverse Gaussian) distribution, as part of the broader effort to implement ICDF methods across all distributions.Currently a draft skeleton with parameter checks is in place. ICDF formula and tests to follow.
Related Issue
Checklist
Type of change