# Compute DIC for fitted mixture model

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

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

### Value

A scalar DIC is returned

### Author(s)

Peter Baker p.baker1@uq.edu.au

### References

G Celeaux et. al. (2006) Deviance Information Criteria for Missing Data Models

*Bayesian Analysis***4**23ppD 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)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.