Sha256: 623fc73a91d64d77dbb8a3eb86a8073254ad350d59d649246df6c2d77cc48666

Contents?: true

Size: 687 Bytes

Versions: 22

Compression:

Stored size: 687 Bytes

Contents

module Distribution
    # Calculate cdf and inverse cdf for Chi Square Distribution.
    # 
    # Based on Statistics2 module
    # 
    module ChiSquare
        class << self
            # Return the P-value of the corresponding integral with 
            # k degrees of freedom
            def p_value(pr,k)
                Statistics2.pchi2X_(k, 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,x)
            end
        end
    end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
statsample-0.13.1 lib/distribution/chisquare.rb
statsample-0.13.0 lib/distribution/chisquare.rb
statsample-0.12.0 lib/distribution/chisquare.rb
statsample-0.11.2 lib/distribution/chisquare.rb
statsample-0.11.1 lib/distribution/chisquare.rb
statsample-0.11.0 lib/distribution/chisquare.rb
statsample-0.10.0 lib/distribution/chisquare.rb
statsample-0.9.0 lib/distribution/chisquare.rb
statsample-0.8.2 lib/distribution/chisquare.rb
statsample-0.8.1 lib/distribution/chisquare.rb
statsample-0.8.0 lib/distribution/chisquare.rb
statsample-0.7.0 lib/distribution/chisquare.rb
statsample-0.6.7 lib/distribution/chisquare.rb
statsample-0.6.5 lib/distribution/chisquare.rb
statsample-0.6.4 lib/distribution/chisquare.rb
statsample-0.6.3 lib/distribution/chisquare.rb
statsample-0.6.2 lib/distribution/chisquare.rb
statsample-0.6.1 lib/distribution/chisquare.rb
statsample-0.6.0 lib/distribution/chisquare.rb
statsample-0.5.1 lib/distribution/chisquare.rb