swapf2                 package:bqtl                 R Documentation

_S_a_m_p_l_e _F_2 _l_o_c_i  _v_i_a _a_p_p_r_o_x_i_m_a_t_e _p_o_s_t_e_r_i_o_r

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

     An MCMC sampler for loci using precomputed dispersion matrices,
     various priors, and a pre-selected set of variables. For use with
     F2 intercross design.

     Using precomputed dispersion matrices, various priors, and a
     pre-selected set of variables, one locus is removed, all other
     loci are examined to determine the effect of each on the
     posterior. One locus is sampled. The process is repeated until
     each locus has been removed and a new one sampled in its place
     (possibly the same one that was removed is sampled).

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

     swapf2(varcov, invars, rparm, nreps, ana.obj, locs = <<see below>>, 
         locs.prior = <<see below>>, combo.prior = <<see below>>, tol = 1e-10)

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

  varcov: The result of ' make.varcov '. The columns of 'varcov$var.x'
          must alternate 'additive' and 'dominance' terms.

   rparm: The 'ridge' parameters for the independent variables - larger
          values imply more shrinkage or a more concentrated prior for
          the regresion coefficients. 

   nreps: How many cycles of MCMC to perform

 ana.obj: A object produced by 'make.analysis.obj'

  invars: A vector of variable indexes. This determines which variables
          to start in the model. If both additive and  dominance terms
          are to be used, they should occupy adjacent locations in
          'invars'. The variable(s) associated with the first locus is
          (are) immediately removed, serving only as placeholder(s). If
          there are k loci associated with the variables, then all
          subsequent models have k loci, although the nuimber of
          variables may vary according to the selection of one or both
          of the 'additive' or 'dominance' terms.  

    locs: The pairs of columns of 'varcov$var.x' to use. The default
          uses all of them.

locs.prior: Vector whose elements are  the prior masses to associate
          with each locus. Typically, these sum to one, but sometimes
          they might each be set to one (as in computing lod scores).
          The default value sets them all to 1.0. 

combo.prior: The prior probability for each term or combination of
          terms for the phenotypic effect at a locus. Typically, there
          will be three of these - one for the 'additive' term (linear
          in number of alleles from one parent strain), the 'dominance'
          term (quadratic in allele number), or both terms. The default
          sets them all to 1/3. 

     tol: Used in forming QR decomposition. Let it be.

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

     A call to 'swapf2' is used to obtain the results. This function is
     really just a wrapper.

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

     A list with components: 

 configs: A 2k by k by nreps array of indexes of variables sampled in
          each of the nreps iterations. Models using less than 2k
          variables 'configs[,i,j]' will contain one or more zeroes in
          the last position(s) 

posteriors: A vector of length 'k*nreps' with the posteriors of the
          models sampled.

   coefs: A 2k by k by nreps matrix of the regression coefficients.
          Models using less than 2k variables  'configs[,i,j]' will
          contain one or more zeroes in the last position(s) 

    call: The call to 'swapf2'

    cond: The 'k*nreps' posterior probabilities of the k-1 gene models.

    marg: The 'k*nreps' marginal posteriors for all k gene models that
          could be formed using the current k-1 gene model)

alt.marginal: A vector with 'length(locs)' elements. At each step, the
          posterior associated with  each candidate locus is added to
          an element of this vector. After all steps are finished, the
          result is normalized to sum to one. This turns out to be an
          exceedingly stable estimate of the relative marginal
          posterior. 

alt.coef: A vector with '2*length(locs)' elements. At each step, the
          product of each posterior times the coefficient associated
          with a candidate variable is  added to an element of this
          vector. After all steps are finished, the result is
          normalized by the total marginal posterior. This turns out to
          be an rather stable estimate of the marginal (over all
          models) posterior mean of the regression coefficients. 

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

     Charles C. Berry cberry@ucsd.edu

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

     Berry C.C. (1998) Computationally Efficient Bayesian QTL Mapping
     in Experimental Crosses. _ASA Proceedings of the Biometrics
     Section,_ 164-169.

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

     'swapbc1'

