How do we relate the chi squared and gamma distributions with code?
For example if we have a chi squared distribution with cdf(x, k)
and we calculate cdf(2,3)
where x is 2 and df is 3, what would be the corresponding cdf for the gamma distribution with cdf(x, k, theta)
? Initially I thought it was cdf(2,3,6
) however this is not working out.
For example when run with node:
const g = require('gamma-distribution');
const c = require('chi-squared');
console.log(g.cdf(2, 3, 6));
console.log(c.cdf(2, 3));
0.004817624857647892
0.4275929370776425
A different way to ask this question is how would we make sure the Chi Square CDF and the Gamma CDF plots were the same if we were entering the parameters in a spreadsheet?