Learn R Programming

polySegratioMM (version 0.6-2)

readJags: Read MCMC sample(s) from a JAGS run

Description

wrapper to read.openbugs which returns object of class mcmc.list and so can be used to specify the start and end iterations for the MCMC sample(s) and also specify thinning

Usage

readJags(run.jags, quiet = TRUE, ...)

Arguments

run.jags
object of class runJAGS produced by running JAGS
quiet
logical to return program output (Default: TRUE)
...
other options for read.openbugs

Value

  • Returns object of class segratioMCMC with components
  • run.jagsobject of class runJAGS produced by running JAGS
  • mcmc.listobject of class mcmc.list containing the MCMC sample(s)

concept

  • segregation ratio
  • dominant marker
  • autopolyploid

See Also

mcmc.list 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
library(polySegratio)

## simulate small autooctaploid data set
a1 <- sim.autoMarkers(8,c(0.7,0.2,0.1),n.markers=100,n.individuals=50)
##print(a1)
sr <-  segregationRatios(a1$markers)
x <- setModel(3,8)
x2 <- setPriors(x)
cat(x$bugs.code,x2$bugs.code,sep="")


x3 <- setModel(3,8, random.effect = TRUE)
x4 <- setPriors(x3, type="strong")

dumpData(sr, x3)
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

xj <- readJags(rj)
print(xj)

Run the code above in your browser using DataLab