PostProbMod             package:MCMCpack             R Documentation

_C_a_l_c_u_l_a_t_e _P_o_s_t_e_r_i_o_r _P_r_o_b_a_b_i_l_i_t_y _o_f _M_o_d_e_l

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

     This function takes an object of class 'BayesFactor' and
     calculates the posterior probability that each model under study
     is correct given that one of the models under study is correct.

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

     PostProbMod(BF, prior.probs=1)

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

      BF: An object of class 'BayesFactor'.

prior.probs: The prior probabilities that each model is correct. Can be
          either a scalar or array. Must be positive. If the sum of the
          prior probabilities is not equal to 1 prior.probs will be
          normalized so that it does sum to unity.

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

     An array holding the posterior probabilities that each model under
     study is correct given that one of the models under study is
     correct.

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

     'MCMCregress'

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

     ## Not run: 
     data(birthwt)

     post1 <- MCMCregress(bwt~age+lwt+as.factor(race) + smoke + ht,
                          data=birthwt, b0=c(2700, 0, 0, -500, -500,
                                             -500, -500),
                          B0=c(1e-6, .01, .01, 1.6e-5, 1.6e-5, 1.6e-5,
                               1.6e-5), c0=10, d0=4500000,
                          marginal.likelihood="Chib95", mcmc=10000)
      
     post2 <- MCMCregress(bwt~age+lwt+as.factor(race) + smoke,
                          data=birthwt, b0=c(2700, 0, 0, -500, -500,
                                             -500),
                          B0=c(1e-6, .01, .01, 1.6e-5, 1.6e-5, 1.6e-5),
                          c0=10, d0=4500000,
                          marginal.likelihood="Chib95", mcmc=10000)

     post3 <- MCMCregress(bwt~as.factor(race) + smoke + ht,
                          data=birthwt, b0=c(2700, -500, -500,
                                             -500, -500),
                          B0=c(1e-6, 1.6e-5, 1.6e-5, 1.6e-5,
                               1.6e-5), c0=10, d0=4500000,
                          marginal.likelihood="Chib95", mcmc=10000)

     BF <- BayesFactor(post1, post2, post3)
     mod.probs <- PostProbMod(BF)
     print(mod.probs)
     ## End(Not run)

