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).
swapf2(varcov, invars, rparm, nreps, ana.obj, locs = <>,
locs.prior = <>, combo.prior = <>, tol = 1e-10)
make.varcov
. The columns of
varcov$var.x
must alternate 'additive' and 'dominance' terms.make.analysis.obj
invars
. The variable(s) associated with the
fivarcov$var.x
to use. The default
uses all of them.configs[,i,j]
will contain one or more zeroes in the last
position(s)k*nreps
with the
posteriors of the models sampled.configs[,i,j]
will contain one or more zeroes in the last
position(s)swapf2
k*nreps
posterior probabilities of the k-1 gene
models.k*nreps
marginal posteriors for all k gene
models that could be formed using the current k-1 gene model)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.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.swapf2
is used to obtain the results. This function
is really just a wrapper.swapbc1