Module: Distribution::ChiSquare::GSL_
- Defined in:
- lib/distribution/chisquare/gsl.rb
Class Method Summary collapse
-
.cdf(x, k) ⇒ Object
Chi-square cumulative distribution function (cdf).
-
.p_value(pr, k) ⇒ Object
Return the P-value of the corresponding integral with k degrees of freedom.
- .pdf(x, k) ⇒ Object
- .rng(k, seed = nil) ⇒ Object
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]
21 22 23 |
# File 'lib/distribution/chisquare/gsl.rb', line 21 def cdf(x, k) GSL::Cdf::chisq_P(x.to_f,k.to_i) end |
.p_value(pr, k) ⇒ Object
Return the P-value of the corresponding integral with k degrees of freedom
13 14 15 |
# File 'lib/distribution/chisquare/gsl.rb', line 13 def p_value(pr,k) GSL::Cdf::chisq_Pinv(pr.to_f,k.to_i) end |
.pdf(x, k) ⇒ Object
8 9 10 |
# File 'lib/distribution/chisquare/gsl.rb', line 8 def pdf(x,k) GSL::Ran::chisq_pdf(x.to_f,k.to_i) end |
.rng(k, seed = nil) ⇒ Object
5 6 7 |
# File 'lib/distribution/chisquare/gsl.rb', line 5 def rng(k,seed=nil) end |