swap {bqtl}  R Documentation 
Given a kgene model as a starting point, one gene is deleted and another is sampled in its place. This is done using an approximation to the posterior. Then another gene is deleted and another sampled,...
swap(varcov, invars, rparm, nreps, ana.obj, ...)
varcov 
The result of 
invars 
Vector of
numerical indexes of 
rparm 
Scalar or vector with 
nreps 
How many cycles (of 
ana.obj 
An 
... 
Additional arguments override the default choices of
candidate loci ( 
An MCMC sampler for loci using the object of 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.
A list with components:
config 
A k by k by nreps array (or, for

posteriors 
A vector of length 
coefs 
A k by k matrix of the regression coefficients(or, for

call 
The call to 
cond 
The 
marg 
The 
alt.marginal 
A vector with 
alt.coef 
A vector with 
Charles C. Berry cberry@ucsd.edu
Berry C.C. (1998) Computationally Efficient Bayesian QTL Mapping in Experimental Crosses. ASA Proceedings of the Biometrics Section, 164169.
data( little.ana.bc )
little.vc < varcov( bc.phenotype~locus(all), little.ana.bc)
little.4 < swap( little.vc, c(1,15,55,75), rparm=1, 50, little.ana.bc )
little.4.smry < summary( little.4 )
print(c("Bayes Factor (3 vs 4)"=little.4.smry$ratio$mean))
par(mfrow=c(3,2))
plot( little.ana.bc, little.4.smry$loc.posterior, type="h",
ylab="E(genes)" )
rm(little.4,little.vc,little.ana.bc)