Search code examples
cchi-squared

Calculating the Chi-square CDF in C


I'm very new to coding in C, and I'm working on calculating the CDF for a chi-square distribution given a value and the degrees of freedom. Is there a function or a library that does this or will I need to write this code myself?

Any help would be appreciated


Solution

  • If I am right you can use the GNU Scientific Library. Look for the function gsl_ran_chisq, which returns a random value from a Chi-square distribution provided a number of degrees of freedom.

    You can check the C functions related to chi-square and many other distributions on this link. Simply install the library. Link to the lib's home page can also be found here.

    I hope I have helped.