math icon indicating copy to clipboard operation
math copied to clipboard

BesselK continuous function

Open stemangiola opened this issue 5 years ago • 4 comments

Description

In order to build robust count models based for example on SICHEL distribution, a continuous version of the BesselK function is needed (nu being real instead of int).

There is a tread here https://discourse.mc-stan.org/t/besselk-with-the-order-v-as-real-parameter/7417/4 but I thought to lounch a feature request since is quite a delicate math function (that is not working natively in log scale in the R version and therefore unstable)

For feature requests:

The code is present in R

https://stat.ethz.ch/R-manual/R-devel/library/base/html/Bessel.html

Expected Output

count ~ sichel(mu, sigma, nu)

Current Version:

v2.18.1

stemangiola avatar Feb 05 '19 01:02 stemangiola

A related issues in stan: https://github.com/stan-dev/stan/issues/1939

martinmodrak avatar Feb 20 '19 11:02 martinmodrak

Could this be useful to build a Matérn covariance function for the Gaussian Processes?

zottelef avatar Feb 21 '19 16:02 zottelef

For anyone wondering here: the PR is closed, but I am making slow progress now and then and have code that works for many contexts. If you need this function, let me know, I might try to increase the priority of resolving it completely :-)

martinmodrak avatar Nov 01 '19 11:11 martinmodrak

With the introduction of hypergeometric pFq I believe we can use that to calculate the derivative of the modified bessel function of the second kind when $\nu \notin \mathbb{Z}$. From https://functions.wolfram.com/Bessel-TypeFunctions/BesselK/20/01/01/0002/

Screen Shot 2022-07-18 at 5 39 47 PM

spinkney avatar Jul 18 '22 21:07 spinkney