Sha256: a3c880cc007f4dfb2b6f06ff1b750f50843099f989d049720a508fe7f0a2cff4

Contents?: true

Size: 595 Bytes

Versions: 1

Compression:

Stored size: 595 Bytes

Contents

module Distribution
  module ChiSquare
    module Statistics2_
      class << self
        # 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

        # Return the P-value of the corresponding integral with
        # k degrees of freedom
        def quantile(pr, k)
          Statistics2.pchi2X_(k.to_i, pr)
        end

        alias_method :p_value, :quantile
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
distribution-0.8.0 lib/distribution/chisquare/statistics2.rb