# calculateDIC: Compute DIC for fitted mixture model In polySegratioMM: Bayesian mixture models for marker dosage in autopolyploids

## Description

Computes and returns the Deviance Information Critereon (DIC) as suggested by Celeaux et al (2006) as their DIC\$_4\$ for Bayesian mixture models

## Usage

 `1` ```calculateDIC(mcmc.mixture, model, priors, seg.ratios, chain=1, print.DIC=FALSE) ```

## Arguments

 `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

## Value

A scalar DIC is returned

## Author(s)

Peter Baker [email protected]

## References

• 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

## See Also

`dosagesMCMC` `readJags`

## 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``` ```## 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) ```

polySegratioMM documentation built on May 31, 2017, 1:46 a.m.