Fitting a non-central chisquare distribution

Hi Stan people,

I am new to Stan and would like to know if it is possible to fit a Noncentral chi-squared distribution. I did no find any information about it so I guess it is not implemented.

However the density of this distribution can be expressed with a formula containing the Confluent hypergeometric function 0F1. But I am not able to find how to call this function in stan code.

I know that stan uses the C++ library “boost” which contains the desired function hypergeometric_0F1.

Could anyone tell me if it possible to call this function in Stan otherwise I will try to find an other method to fit my data ?

Thank you.

Stan has the modified bessel function of the first kind (as well as the log version) at 3.13 Combinatorial Functions | Stan Functions Reference.

You can then follow the alternative definition in wikipedia Noncentral chi-squared distribution - Wikipedia

Indeed ! Thank you for your very quick answer.
Sorry for not seeing this by myself.