Computation of polygamma function


pcastine
02-14-2006, 04:38 PM
Hello,

I'm looking for code to calculate digamma & Co. (polygamma functions, aka psi). This is (AFAICT) not addressed in NR. Does anyone have pointers of where I could look? I've Googled both web and groups without finding anything helpful.

Looking at the definition of psi, it seems there must be a reasonable numeric approach, but it escapes me.

Thanks,
Peter

joeyyh
04-27-2006, 08:08 AM
I'm also interested in the numerical scheme of digamma (psi) function. I expect even more - the input value can be a complex number. psi and gamma functions are available in both Matlab and R but only for real number.

Joey

pcastine
04-27-2006, 08:44 AM
I eventually was pointed to code written in S+ (a programming language for statistics) written by Bill Venables.

Venables' code was, as I recall, complex-capable. I wrote a C port, but I didn't need complex so I only dealt with real.

Google should turn up the original code. Try that first. If you can't find it, send me a private message and I'll try to dig up the code. The S+ language has a few idiosyncracies, but they're pretty obvious once you've figured them out %-} You may want to Google for a language refman as well.