Reputation: 43
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
Upvotes: 4
Views: 1285
Reputation: 156
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.
Upvotes: 2