BsProb                 package:BsMD                 R Documentation

_P_o_s_t_e_r_i_o_r _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 _S_c_r_e_e_n_i_n_g _E_x_p_e_r_i_m_e_n_t_s

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

     Marginal factor posterior probabilities and model posterior
     probabilities from designed screening experiments are calculated
     according to Box and Meyer's Bayesian procedure.

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

         BsProb(X, y, blk, mFac, mInt = 2, p = 0.25, g = 2, ng = 1, nMod = 10)

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

       X: Matrix. The design matrix.

       y: vector. The response vector.

     blk: integer. Number of blocking factors (>=0). These factors are
          accommodated in the first columns of matrix 'X'. There are
          'ncol(X)-blk' design factors.

    mFac: integer. Maximum number of factors included in the models.

    mInt: integer <= 3. Maximum order of interactions considered in the
          models.

       p: numeric. Prior probability assigned to active factors.

       g: vector. Variance inflation factor(s) gammaassociated to
          active and interaction factors.

      ng: integer <=20. Number of different variance inflation factors
          ('g') used in calculations.

    nMod: integer <=100. Number of models to keep with the highest
          posterior probability.

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

     Factor and model posterior probabilities are computed by Box and
     Meyer's Bayesian procedure. The design factors are accommodated in
     the matrix 'X' after 'blk' columns of the blocking factors. So,
     'ncol(X)-blk' design factors are considered. If 'g', the variance
     inflation factor (VIF) gamma, is a vector of length 1, the same
     VIF is used for factor main effects and interactions. If the
     length of 'g' is 2 and 'ng' is 1, 'g[1]' is used for factor main
     effects and 'g[2]' for the interaction effects. If 'ng' greater
     than 1, then 'ng' values of VIFs between 'g[1]' and 'g[2]' are
     used for calculations with the same gamma value for main effects
     and interactions. The function calls the FORTRAN subroutine 'bm'
     and captures summary results. The complete output of the FORTRAN
     code is save in the 'BsPrint.out' file in the working directory.
     The output is a list of class 'BsProb' for which 'print', 'plot'
     and 'summary' methods are available.

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

     A list with all output parameters of the FORTRAN subroutine 'bm'.
     The names of the list components are such that they match the
     original FORTRAN code. Small letters used for capturing program's
     output. 

       X: matrix. The design matrix.

       Y: vector. The response vector.

       N: integer. The number of runs.

    BLKS: integer. The number of blocking factors accommodated in the
          first columns of matrix 'X'.

   MXFAC: integer. Maximum number of factors considered in the models.

   MXINT: integer. Maximum interaction order considered in the models.

      PI: numeric. Prior probability assigned to the active factors.

  INDGAM: integer. If 0, the same variance inflation factor ('GAMMA')
          is used for main and interactions effects. If 'INDGAM ==1',
          then 'NGAM' different values of 'GAMMA' were used.

   INDG2: integer. If 1, the variance inflation factor 'GAM2' was used
          for the interaction effects.

    NGAM: integer. Number of different VIFs used for computations.

   GAMMA: vector. Vector of variance inflation factors of length 1 or
          2.

    NTOP: integer. Number of models with the highest posterior
          probability

   mdcnt: integer. Total number of models evaluated.

    ptop: vector. Vector of probabilities of the top 'ntop' models.

  sigtop: vector.  Vector of sigma-squared of the top 'ntop' models.

   nftop: integer.  Number of factors in each of the 'ntop' models.

    jtop: matrix. Matrix of the number of factors and their labels of
          the top 'ntop' models.

     del: numeric. Interval width of the 'GAMMA' partition.

   sprob: vector. Vector of posterior probabilities. If 'ng>1' the
          probabilities are weighted averaged over 'GAMMA'.

    pgam: vector. Vector of values of the unscaled posterior density of
          'GAMMA'.

    prob: matrix. Matrix of marginal factor posterior probabilities for
          each of the different values of 'GAMMA'.

     ind: integer. Indicator variable. 'ind' is 1 if the 'bm'
          subroutine exited properly. Any other number correspond to
          the format label number in the FORTRAN subroutine script.

_N_o_t_e:

     The function is a wrapper to call the FORTRAN subroutine 'bm',
     modification of Daniel Meyer's original program, 'mbcqp5.f', for
     the application of Bayesian design and analysis of fractional
     factorial experiments, part of the 'mdopt' bundle, available at
     _StatLib_.

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

     R. Daniel Meyer. Adapted for R by Ernesto Barrios.

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

     Box, G. E. P and R. D. Meyer (1986). "An Analysis for Unreplicated
     Fractional Factorials". _Technometrics._ Vol. 28. No. 1. pp.
     11-18.

     Box, G. E. P and R. D. Meyer (1993). "Finding the Active Factors
     in Fractionated Screening Experiments". _Journal of Quality
     Technology._ Vol. 25. No. 2. pp. 94-105.

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

     'print.BsProb', 'print.BsProb', 'summary.BsProb'.

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

     library(BsMD)
     data(BM86.data,package="BsMD")
     X <- as.matrix(BM86.data[,1:15])
     y <- BM86.data["y1"]
     # Using prior probability of p = 0.20, and k = 10 (gamma = 2.49)
     drillAdvance.BsProb <- BsProb(X = X, y = y, blk = 0, mFac = 15, mInt = 1,
                 p = 0.20, g = 2.49, ng = 1, nMod = 10)
     plot(drillAdvance.BsProb)
     summary(drillAdvance.BsProb)

     # Using prior probability of p = 0.20, and a 5 <= k <= 15 (1.22 <= gamma <= 3.74)
     drillAdvance.BsProbG <- BsProb(X = X, y = y, blk = 0, mFac = 15, mInt = 1,
                 p = 0.25, g = c(1.22, 3.74), ng = 3, nMod = 10)
     plot(drillAdvance.BsProbG, code = FALSE, prt = TRUE)

