Learn R Programming

polySegratioMM (version 0.6-2)

runJags: 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.controlObject of class jagsControl
  • exitinteger indicating return error (0 if no errors)
  • cmd.fileJAGS command file
  • start.timetime JAGS run started
  • end.timetime JAGS run finished
  • elapsed.timeelapsed user and system time
  • callfunction call

concept

  • segregation ratio
  • dominant marker
  • autopolyploid

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

Run this code
## 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")

small <- setControl(x, burn.in=20, sample=50)
writeControlFile(small)
rj <- runJags(small)  ## just run it
print(rj)

Run the code above in your browser using DataLab