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

Description Usage Arguments Value Author(s) See Also Examples

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

1
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.jags

object of class runJAGS produced by running JAGS

mcmc.list

object of class mcmc.list containing the MCMC sample(s)

Author(s)

Peter Baker p.baker1@uq.edu.au

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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="\n")


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)
## Not run: 
rj <- runJags(small)  ## just run it

xj <- readJags(rj)
print(xj)

## End(Not run)

polySegratioMM documentation built on May 2, 2019, 9:49 a.m.