Sha256: 623539f98cde1397244e2c4e626dbd0468d953e23ecc8a48f0c3e408022e10ef

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

require 'rbconfig'
module Distribution
  module T
    module Statistics2_
      class << self
        # There are some problem on i686 with t on statistics2
        if true || !RbConfig::CONFIG['arch'] =~ /i686/
          # T cumulative distribution function (cdf).
          #
          # Returns the integral of t-distribution
          # with n degrees of freedom over (-Infty, x].
          #
          def cdf(x, k)
            Statistics2.tdist(k, x)
          end

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

          alias_method :p_value, :quantile
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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