laplace              package:LearnBayes              R Documentation

_S_u_m_m_a_r_i_z_a_t_i_o_n _o_f _a _p_o_s_t_e_r_i_o_r _d_e_n_s_i_t_y _b_y _t_h_e _L_a_p_l_a_c_e _m_e_t_h_o_d

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

     For a general posterior density, computes the posterior mode,  the
     associated variance-covariance matrix, and an estimate at the
     logarithm at the normalizing constant.

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

     laplace(logpost,mode,iter,par)

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

 logpost: function that defines the logarithm of the posterior density

    mode: vector that is a guess at the posterior mode

    iter: number of iterations of Newton-Raphson algorithm

     par: vector or list of parameters associated with the function
          logpost

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

    mode: current estimate at the posterior mode

     var: current estimate at the associated variance-covariance matrix

     int: estimate at the logarithm of the normalizing constant

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

     Jim Albert

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

     logpost=function(theta,data)
     {
     s=5
     val=0*theta
     for (i in 1:length(data))
     {
     val=val-log(1+(data[i]-theta)^2/s^2)
     }
     return(val)
     }
     data=c(10,12,14,13,12,15)
     laplace(logpost,10,5,data)

