Learn R Programming

bqtl (version 1.0-7)

swapf2: Sample F2 loci via approximate posterior

Description

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).

Usage

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

Arguments

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 fi
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
tol
Used in forming QR decomposition. Let it be.

Value

  • A list with components:
  • configsA 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)
  • posteriorsA vector of length k*nreps with the posteriors of the models sampled.
  • coefsA 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)
  • callThe call to swapf2
  • condThe k*nreps posterior probabilities of the k-1 gene models.
  • margThe k*nreps marginal posteriors for all k gene models that could be formed using the current k-1 gene model)
  • alt.marginalA 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.coefA 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.

Details

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

References

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

See Also

swapbc1