Package: |
polySegratioMM |
Type: |
Package |
Version: |
0.6-4 |
Date: |
2018-03-22 |
The simplest way to fit a model is to use runSegratioMM
.
Given segregation ratios and a ploidy level, a mixture model is
constructed with default priors and initial values and JAGS
run
to produce an MCMC sample for statistical inference.
A standard model may be set up with setModel
where two
parameters are set, namely ploidy.level
or the number of
homologous chromosomes set either as a numeric or as a character
string and also n.components
or the number of components for
mixture model (less than or equal to maximum number of possible
dosages).
Vague or strong priors may be constructed automatically using
setPriors
. Plots of standard conjugate distributions may
be obtained using DistributionPlotBinomial
DistributionPlotGamma
and
DistributionPlotNorm
.
If necessary, other operations like setting up initial values or the
control files for JAGS
may be set using setInits
setControl
dumpData
dumpInits
writeControlFile
writeJagsFile
. Once the
BUGS
files and JAGS
control files are set up then
JAGS
may be run using runJags
and results read
using readJags
.
Convergence diagnostics may be carried out using coda
or the
convenience wrapper diagnosticsJagsMix
.
Dose allocation can be carried out using dosagesJagsMix
.
Plots may be produced and objects printed and summarised using standard
print
and plot
methods. Plots of theoretical
binomial distributions with different ploidy levels and sample sizes may
be obtained with plotFitted
. In addition,
plotFitted
produces a lattice plot of the observed
segregation ratios and fitted mixture model on the logit scale.