File: statistics2.rb

package info (click to toggle)
ruby-distribution 0.7.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 624 kB
  • ctags: 379
  • sloc: ruby: 4,283; makefile: 7
file content (21 lines) | stat: -rw-r--r-- 523 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Distribution
  module ChiSquare
    module Statistics2_
      class << self
      # Return the P-value of the corresponding integral with 
      # k degrees of freedom
      def p_value(pr,k)
        Statistics2.pchi2X_(k.to_i, pr)
      end
      # Chi-square cumulative distribution function (cdf).
      # 
      # Returns the integral of Chi-squared distribution 
      # with k degrees of freedom over [0, x]
      # 
      def cdf(x, k)
        Statistics2.chi2dist(k.to_i,x)
      end
    end
  end
  end
end