Hi I seek a source code of program in C++ which calculate CDF of Gamma distribution for me. Do you know where I can find this program or its algorithm? Isar PhD student of Bioinformatics Isar Nassiri@gmail.com
Hi I seek a source code of program in C++ which calculate CDF of Gamma distribution for me. Do you know where I can find this program or its algorithm? Isar PhD student of Bioinformatics Isar Nassiri@gmail.com
kfunc.c from samtools. It implements complete and incomplete gamma functions. Then it is straightforward to calculate CDF. Samtools also comes with a few other gems C programmers may be interested in (e.g. Fisher's exact test; Brent's method; sorting; hash table; fasta/fastq parser; ...).
EDIT: You can also use GSL. Samtools does not use GSL because GSL is GPL'ed, while samtools is licensed under MIT. Even if GSL were released in a permissive license, it would always be a bad idea to request the users to install a non-standard library GSL for a simple function like an incomplete gamma function. If you write programs for yourself, all these concerns do not matter to you. GSL is a great general numerical library.
For C++ programmers, boost is a great resource for special mathematical functions (incomplete gamma function) and many other things. You may copy-paste boost source code if you do not like dependencies.
Try this: http://www.codecogs.com/code/statistics/distributions/continuous/gamma/cdf.php, you do need a commercial license for the source code.
You can find source code in Numerical Recipes. If you dont have it. Buy it! Its worth its weight in gold. An academic library should also work.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.