Sha256: 997709dc6034b3f49f059cda609595b8bdf8c4482f91a8beffe58d27fb63b197

Contents?: true

Size: 642 Bytes

Versions: 1

Compression:

Stored size: 642 Bytes

Contents

module Distribution
  module Beta
    module GSL_
      class << self
        def pdf(x, a, b)
          GSL::Ran.beta_pdf(x.to_f, a.to_f, b.to_f)
        end
        # Return the P-value of the corresponding integral with
        # k degrees of freedom
        def p_value(pr, a, b)
          GSL::Cdf.beta_Pinv(pr.to_f, a.to_f, b.to_f)
        end
        # Beta cumulative distribution function (cdf).
        #
        # Returns the integral of Beta distribution
        # with parameters +a+ and +b+ over [0, x]
        #
        def cdf(x, a, b)
          GSL::Cdf.beta_P(x.to_f, a.to_f, b.to_f)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
distribution-0.7.3 lib/distribution/beta/gsl.rb