public double ChiSquared(int df) { if (df <= 0) { throw new ArgumentException("df (" + df + ") is not greater than 0"); } return this.Gamma(df / 2.0, 2); }