runJags {polySegratioMM} | R Documentation |
Run JAGS to create MCMC sample for segregation ratio mixture model
Description
Runs external program JAGS
and returns MCMC list for processing
by coda
.
Usage
runJags(jags.control, jags = "jags", quiet = FALSE,
cmd.file = paste(jags.control$stem, ".cmd", sep = ""), timing = TRUE)
Arguments
jags.control |
Object of class |
jags |
Name of |
quiet |
Locial to return program output (Default: FALSE) |
cmd.file |
|
timing |
Logical to return timing information such as date started and ended and elapsed user and system time |
Value
Returns object of class runJAGS
with components
jags.control |
Object of class |
exit |
integer indicating return error (0 if no errors) |
cmd.file |
|
start.time |
time JAGS run started |
end.time |
time JAGS run finished |
elapsed.time |
elapsed user and system time |
call |
function call |
Author(s)
Peter Baker p.baker1@uq.edu.au
See Also
setPriors
setInits
expected.segRatio
segRatio
setControl
dumpData
dumpInits
or for an easier way to
run a segregation ratio mixture model see
runSegratioMM
Examples
## simulate small autooctaploid data set
a1 <- sim.autoMarkers(8,c(0.7,0.2,0.1),n.markers=100,n.individuals=50)
sr <- segregationRatios(a1$markers)
## set up model with 3 components
x <- setModel(3,8)
x2 <- setPriors(x)
dumpData(sr, x)
inits <- setInits(x,x2)
dumpInits(inits)
##x.priors <- setPriors(x, "vague")
writeJagsFile(x, x2, stem="test")
## Not run:
small <- setControl(x, burn.in=20, sample=50)
writeControlFile(small)
rj <- runJags(small) ## just run it
print(rj)
## End(Not run)