Use of digamma function in root

Dear,

For my project I have to fit a gamma distribution through my data points. This fit works well, but I want to extract data points from this fit with error bars. For these error bars I use partial derivatives w.r.t. to each parameter of my gamma distribution. Well here arises the problem…
The derivative of the gamma distribution yields a digamma function, which I can’t find in the ROOT documentation. Is there another way to implement this function into ROOT?

Remco de Smit

Hi,
The digamma funciton is not available directly in ROOT. We could provide it if you think is needed.
However, you can use it from GSL available through MathMore., that is an optional library of ROOT.
From the prompt you just need to do:

#include "gsl/gsl_sf_psi.h"
gSystem->Load("libMathMore");
cout << gsl_sf_psi(1.) << endl;

see https://www.gnu.org/software/gsl/manual/html_node/Digamma-Function.html#Digamma-Function

Lorenzo

1 Like