Binom-class              package:distr              R Documentation

_C_l_a_s_s "_B_i_n_o_m"

_D_e_s_c_r_i_p_t_i_o_n:

     The binomial distribution with 'size' = n, by default =1, and
     'prob' = p, by default =0.5, has density

                  p(x) = choose(n,x) p^x (1-p)^(n-x)

     for x = 0, ..., n.

     C.f.'rbinom'

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'Binom(prob, size)'.
     This object is a binomial distribution.

_S_l_o_t_s:

     '_i_m_g': Object of class '"Naturals"': The space of the image of
          this distribution has got dimension 1 and the name "Natural
          Space". 

     '_p_a_r_a_m': Object of class '"BinomParameter"': the parameter of this
          distribution ('prob', 'size'), declared at its instantiation 

     '_r': Object of class '"function"': generates random numbers (calls
          function 'rbinom') 

     '_d': Object of class '"function"': density function (calls
          function 'dbinom') 

     '_p': Object of class '"function"': cumulative function (calls
          function 'pbinom') 

     '_q': Object of class '"function"': inverse of the cumulative
          function (calls function 'qbinom'). The quantile is defined
          as the smallest value x such that F(x) >= p, where F is the
          cumulative function. 

     '_s_u_p_p_o_r_t': Object of class '"numeric"': a (sorted) vector
          containing the support of the discrete density function

_E_x_t_e_n_d_s:

     Class '"DiscreteDistribution"', directly.
      Class '"UnivariateDistribution"', by class
     '"DiscreteDistribution"'.
      Class '"Distribution"', by class '"DiscreteDistribution"'.

_M_e_t_h_o_d_s:

     + 'signature(e1 = "Binom", e2 = "Binom")': For two binomial
          distributions with equal probabilities the exact convolution
          formula is implemented thereby improving the general
          numerical approximation.

     _i_n_i_t_i_a_l_i_z_e 'signature(.Object = "Binom")': initialize method 

     _p_r_o_b 'signature(object = "Binom")': returns the slot 'prob' of the
          parameter of the distribution 

     _p_r_o_b<- 'signature(object = "Binom")': modifies the slot 'prob' of
          the parameter of the distribution 

     _s_i_z_e 'signature(object = "Binom")': returns the slot 'size' of the
          parameter of the distribution 

     _s_i_z_e<- 'signature(object = "Binom")': modifies the slot 'size' of
          the parameter of the distribution 

_A_u_t_h_o_r(_s):

     Thomas Stabla Thomas.Stabla@uni-bayreuth.de,
      Florian Camphausen Florian.Camphausen@uni-bayreuth.de,
      Peter Ruckdeschel Peter.Ruckdeschel@uni-bayreuth.de,
      Matthias Kohl Matthias.Kohl@uni-bayreuth.de

_S_e_e _A_l_s_o:

     'BinomParameter-class' 'DiscreteDistribution-class'
     'Naturals-class' 'rbinom'

_E_x_a_m_p_l_e_s:

     B=Binom(prob=0.5,size=1) # B is a binomial distribution with prob=0.5 and size=1.
     r(B)(1) # # one random number generated from this distribution, e.g. 1
     d(B)(1) # Density of this distribution is  0.5 for x=1.
     p(B)(0.4) # Probability that x<0.4 is 0.5.
     q(B)(.1) # x=0 is the smallest value x such that p(B)(x)>=0.1.
     size(B) # size of this distribution is 1.
     size(B)=2 # size of this distribution is now 2.
     C=Binom(prob=0.5,size=1) # C is a binomial distribution with prob=0.5 and size=1.
     D=Binom(prob=0.6,size=1) # D is a binomial distribution with prob=0.6 and size=1.
     E=B+C # E is a binomial distribution with prob=0.5 and size=3.
     F=B+D # F is an object of class DiscreteDistribution.

