Open zoj613 opened 1 month ago
Thank you for reaching out! This is interesting. Ultimately it would be nice to get a pure Julia implementation of the PG distribution in Distributions.jl, which requires the MIT license. It's a bit of a longer term goal for me though. Your C code looks well organized, even to my inexperienced C eyes. Translating to Julia seems doable when I find the time.
I believe the MIT and BSD-3 licenses are compatible, but if that's not enough i'd be happy to add dual licensing for the code to allow easy sharing. I tried to sprinkle as many comments as possible and also add references to used sampled algorithms so the reader can easily follow the code. However when you do get to porting it to Julia and maybe run into subtle issues that are not obvious from reading the C code, i'll be happy to explain in detail.
There is another implementation of the distribution I wrote a few years ago hosted at https://github.com/zoj613/polyagamma. It is licensed under the BSD-3 license and it's implementation is completely based on the papers referenced in its readme and does not follow the C++ implementation you mentioned. It is also faster than the C++. If merging into the upstream package referenced here is of big importance, then you could consider rewriting this package using https://github.com/zoj613/polyagamma as the base.