Description Usage Arguments Value Author(s) References See Also Examples
Computes and returns the Deviance Information Critereon (DIC) as suggested by Celeaux et al (2006) as their DIC$_4$ for Bayesian mixture models
1 | calculateDIC(mcmc.mixture, model, priors, seg.ratios, chain=1, print.DIC=FALSE)
|
mcmc.mixture |
Object of type |
model |
object of class |
priors |
Object of class |
seg.ratios |
Object of class |
chain |
Which chain to use when compute dosages (Default: 1) |
print.DIC |
Whether to print DIC |
A scalar DIC is returned
Peter Baker p.baker1@uq.edu.au
G Celeaux et. al. (2006) Deviance Information Criteria for Missing Data Models Bayesian Analysis 4 23pp
D Spiegelhalter et. el. (2002) Bayesian measures of model complexity and fit JRSS B 64 583–640
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 | ## simulate small autooctaploid data set
a1 <- sim.autoMarkers(8,c(0.7,0.2,0.1),n.markers=100,n.individuals=50)
## compute segregation ratios
sr <- segregationRatios(a1$markers)
## set up model, priors, inits etc and write files for JAGS
x <- setModel(3,8)
x2 <- setPriors(x)
dumpData(sr, x)
inits <- setInits(x,x2)
dumpInits(inits)
writeJagsFile(x, x2, stem="test")
## Not run:
## run JAGS
small <- setControl(x, burn.in=200, sample=500)
writeControlFile(small)
rj <- runJags(small) ## just run it
print(rj)
## read mcmc chains and print DIC
xj <- readJags(rj)
print(calculateDIC(xj, x, x2, sr))
## End(Not run)
|
Loading required package: polySegratio
Warning: segregation proportions truncated to length 3
CMD File: test.cmd
JAGS started at Tue Nov 12 15:22:17 2019
JAGS run completed successfully at Tue Nov 12 15:22:17 2019
Elapsed times:
user system elapsed
0.226 0.006 0.243
[1] 708.7819
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.