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 jagsControl containing MCMC burn in, sample and thinning as well as relavant files for BUGS commands, inits and data
jags Name of JAGS program assumed to be in PATH. However, jags may explicitly set here to include the full path name
quiet Locial to return program output (Default: FALSE)
cmd.file JAGS .cmd commad file (Default: deduced from jags.control)
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 jagsControl
exit integer indicating return error (0 if no errors)
cmd.file JAGS command 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)

[Package polySegratioMM version 0.5-2 Index]