lib/rubystats/binomial_distribution.rb
# Cumulative binomial distribution function (equivalent to R pbinom function).
# _x should be integer-valued and can be single integer or array of integers
# returns single value or array containing probability that a stochastic 
# variable x is less then X, i.e. P(x < _x).
Cumulative binomial distribution function (equivalent to R pbinom function).
_x should be integer-valued and can be single integer or array of integers
returns single value or array containing probability that a stochastic
variable x is less then X, i.e.
Cumulative binomial distribution function ( equivalent to R pbinom function ) . _x should be integer - valued and can be single integer or array of integers returns single value or array containing probability that a stochastic variable x is less then X i . e .
def cdf(_x)
      if _x.class == Array
        inv_vals = []
        for i in (0 ..._x.length)
          pdf_vals[i] = get_cdf(_x[i])
        end
        return pdf_vals
      else
        return get_cdf(_x)
      end
    end
def cdf ( _x ) if _x . class == Array inv_vals = [ ] for i in ( 0 ... _x . length ) pdf_vals [ i ] = get_cdf ( _x [ i ] ) end return pdf_vals else return get_cdf ( _x ) end end
Cumulative binomial distribution function (equivalent to R pbinom function).
Cumulative binomial distribution function ( equivalent to R pbinom function ) .
_x
<not_specific>