RFC: Add Generalized Hyperbolic distribution (tracking issue)
Description
This RFC proposes adding a full implementation of the Generalized Hyperbolic statistical distribution to stdlib, including all standard distribution properties and functions.
Hey, I would like to work on this issue!
Hi @Planeshifter,
I've been reviewing the requirements for the Generalized Hyperbolic distribution and noticed that sub-issue #5487 is currently blocked because stdlib lacks the Modified Bessel function of the second kind (besselk) for real-valued orders.
Given the context of my recent work on special functions (like asechf), I would be interested in tackling the implementation of this Bessel function as a standalone package (@stdlib/math/base/special/besselk) to help unblock the distribution.
Implementation Plan: I understand that direct computation using the standard definition is unstable for integer orders. My plan is to research and port a stable numerical algorithm (likely referencing logic from Cephes or AMOS) to correctly handle:
- Both integer and non-integer (real-valued) orders.
- Asymptotic expansions for large inputs.
- Domain errors and edge cases (NaN, Infinity).
Should I open a new RFC/issue to track the implementation of besselk separately, or would you prefer I track it here?