Module: Distribution::Gamma::GSL_

Defined in:
lib/distribution/gamma/gsl.rb

Class Method Summary collapse

Class Method Details

.cdf(x, a, b) ⇒ Object

Chi-square cumulative distribution function (cdf).

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



14
15
16
# File 'lib/distribution/gamma/gsl.rb', line 14

def cdf(x, a, b)
  GSL::Cdf.gamma_P(x.to_f, a.to_f, b.to_f)
end

.pdf(x, a, b) ⇒ Object



5
6
7
# File 'lib/distribution/gamma/gsl.rb', line 5

def pdf(x, a, b)
  GSL::Ran.gamma_pdf(x.to_f, a.to_f, b.to_f)
end

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

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



20
21
22
# File 'lib/distribution/gamma/gsl.rb', line 20

def quantile(pr, a, b)
  GSL::Cdf.gamma_Pinv(pr.to_f, a.to_f, b.to_f)
end