bma.predict           package:iterativeBMA           R Documentation

_P_r_e_d_i_c_t_e_d _P_r_o_b_a_b_i_l_i_t_i_e_s _f_r_o_m _B_a_y_e_s_i_a_n _M_o_d_e_l _A_v_e_r_a_g_i_n_g

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

     This function computes the predicted posterior probability  that
     each test sample belongs to class 1.  It assumes 2-class data, and
     requires the true class labels to be known.

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

     bma.predict (newdataArr, postprobArr, mleArr)

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

newdataArr: a vector consisting of the data from a test sample.

postprobArr: a vector consisting of the posterior probability of each
          BMA selected model.

  mleArr: matrix with one row per model and one column per variable
          giving  the maximum likelihood estimate of each coefficient
          for each  BMA selected model.

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

     Let Y be the response variable (class labels for samples in our
     case).  In Bayesian Model Averaging (BMA), the posterior 
     probability of Y=1 given the training set is the weighted  average
     of the posterior probability of Y=1 given the training set  and
     model M multiplied by the posterior probability of model M  given
     the training set, summing over a set of models M.

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

     A real number between zero and one, representing the predicted
     posterior probability.

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

     Raftery, A.E. (1995).  Bayesian model selection in social research
     (with Discussion). Sociological Methodology 1995 (Peter V.
     Marsden, ed.), pp. 111-196, Cambridge, Mass.: Blackwells.

     Yeung, K.Y., Bumgarner, R.E. and Raftery, A.E. (2005)  Bayesian
     Model Averaging: Development of an improved multi-class, gene
     selection and classification tool for microarray data. 
     Bioinformatics 21: 2394-2402.

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

     'brier.score', 'iterateBMAglm.train'

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

     library (Biobase)
     library (BMA)
     library (iterativeBMA)
     data(trainData)
     data(trainClass)

     ## training phase: select relevant genes
     ret.bic.glm <- iterateBMAglm.train (train.expr.set=trainData, trainClass, p=100)

     ## get the selected genes with probne0 > 0
     ret.gene.names <- ret.bic.glm$namesx[ret.bic.glm$probne0 > 0]

     data (testData)

     ## get the subset of test data with the genes from the last iteration of bic.glm
     curr.test.dat <- t(exprs(testData)[ret.gene.names,])

     ## to compute the predicted probabilities for the test samples
     y.pred.test <- apply (curr.test.dat, 1, bma.predict, postprobArr=ret.bic.glm$postprob, mleArr=ret.bic.glm$mle)

     ## compute the Brier Score if the class labels of the test samples are known
     data (testClass)
     brier.score (y.pred.test, testClass)

