Compute DIC for fitted mixture model
Computes and returns the Deviance Information Critereon (DIC) as suggested by Celeaux et al (2006) as their DIC for Bayesian mixture models
calculateDIC(mcmc.mixture, model, priors, seg.ratios, chain=1, print.DIC=FALSE)
mcmc.mixture
: Object of type segratioMCMC
produced by coda
usually by using readJags
model
: object of class modelSegratioMM
specifying model parameters, ploidy etc
priors
: Object of class priorsSegratioMM
seg.ratios
: Object of class segRatio
contains the segregation ratios for dominant markers and other information such as the number of dominant markers per individual
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
dosagesMCMC
readJags
## 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)
Useful links