impsampling            package:LearnBayes            R Documentation

_I_m_p_o_r_t_a_n_c_e _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 importance sampling to compute the posterior mean of a
     function using a multivariate t proposal density

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

     impsampling(logf,tpar,h,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

       h: function that defines h(theta)

       n: number of simulated draws from proposal density

    data: data and or parameters used in the function logf

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

     est: estimate at the posterior mean

      se: simulation standard error of estimate

   theta: matrix of simulated draws from proposal density

      wt: vector of importance sampling weights

_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)
     myfunc=function(theta)
      return(theta[,2])
     theta=impsampling(betabinexch,tpar,myfunc,1000,cancermortality)

