Module: Distribution::ChiSquare::Statistics2_

Defined in:
lib/distribution/chisquare/statistics2.rb

Class Method Summary collapse

Class Method Details

.cdf(x, k) ⇒ Object

Chi-square cumulative distribution function (cdf).

Returns the integral of Chi-squared distribution with k degrees of freedom over [0, x]



10
11
12
# File 'lib/distribution/chisquare/statistics2.rb', line 10

def cdf(x, k)
  Statistics2.chi2dist(k.to_i, x)
end

.quantile(pr, k) ⇒ Object Also known as: p_value

Return the P-value of the corresponding integral with k degrees of freedom



16
17
18
# File 'lib/distribution/chisquare/statistics2.rb', line 16

def quantile(pr, k)
  Statistics2.pchi2X_(k.to_i, pr)
end