rvbern                  package:rv                  R Documentation

_G_e_n_e_r_a_t_e _a _R_a_n_d_o_m _V_e_c_t_o_r _f_r_o_m _a _B_e_r_n_o_u_l_l_i _S_a_m_p_l_i_n_g _M_o_d_e_l

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

     'rvbern' generates a random vector where each simulation comes
     from a Bernoulli sampling distribution.

_U_s_a_g_e:

       rvbern(n=1, prob)

_A_r_g_u_m_e_n_t_s:

       n: number of random scalars to draw

    prob: probability of ``success"; may be a random vector itself

_D_e_t_a_i_l_s:

     'rvbern' is a special case of 'rvbinom' with the argument size=1.

_V_a_l_u_e:

     A random vector (an rv object) of length 'n'.

_N_o_t_e:

     The resulting vector will not be  independent and identically
     distributed Bernoulli unless 'prob' is a fixed number.

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

     Jouni Kerman kerman@stat.columbia.edu <URL:
     http://www.stat.columbia.edu/~kerman>

_R_e_f_e_r_e_n_c_e_s:

     Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing
     Posterior Simulations Using Random Variable Objects. Technical
     report, Columbia University, New York.

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

       rvbern(10, prob=0.5)
       rvbinom(10, size=1, prob=0.5) # Equivalent

