rejectsampling          package:LearnBayes          R Documentation

_R_e_j_e_c_t_i_n_g _s_a_m_p_l_i_n_g _u_s_i_n_g _a _t _p_r_o_p_o_s_a_l _d_e_n_s_i_t_y

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

     Implements a rejection sampling algorithm for a probability
     density using a multivariate t proposal density

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

     rejectsampling(logf,tpar,dmax,n,data)

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

    logf: function that defines the logarithm of the density of
          interest

    tpar: list of parameters of t proposal density including the mean
          m, scale matrix var,  and degrees of freedom df

    dmax: logarithm of the rejection sampling constant

       n: number of simulated draws from proposal density

    data: data and or parameters used in the function logf

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

     matrix of simulated draws from density of interest

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

     Jim Albert

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

     data(cancermortality)
     start=array(c(-7,6),c(1,2))
     fit=laplace(betabinexch,start,5,cancermortality)
     tpar=list(m=fit$mode,var=2*fit$var,df=4)
     theta=rejectsampling(betabinexch,tpar,-569.2813,1000,cancermortality)

