swapbc1(varcov, invars, rparm, nreps, ana.obj, locs=seq(ncol(var.x)),
locs.prior=rep(1, ncol(var.x)),tol=1e-10 )
make.varcov
nrow(varcov$var.x)
elements;
the 'ridge' parameters for the independent variables - larger values
imply more shrinkage or a more concentrated prior for the regresion
coefficients.make.analysis.obj
k <- length(invars)
varcov$var.x
to use. The default uses all of
them.k*nreps
with the
posteriors of the models.swapbc1
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 modellength(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 marginal posterior.length(locs)
elements. At
each step, the product of each posterior times the coefficient
associated with a candidate locus 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 exceedingly stable estimate of the marginal (over all
models) posterior mean of the regression coefficients.make.varcov
is
executed. This sampler uses the exact posterior probability under the
assumed correctness of the regression model using expected genotypes
given marker values. This amounts to linearizing the likelihood with
respect to the (possibly unknown) locus states. For models where the
loci are fully informative markers this is the true posterior. The chain is implemented as follows: given a set of regressor
variables to start, one variable is removed, all regressor
variables not in the model are examined to determine the effect of each
on the posterior. One variable is sampled. The process is repeated until
each variable has been removed and a new one sampled in its place
(possibly the same variable that was removed is sampled). And this whole
cycle is repeated nreps
times.
swapf2