Learn R Programming

polySegratioMM (version 0.6-2)

setInits: Set up and dump initial values given the model and prior

Description

Given a model of class modelSegratioMM and priors of class priorsSegratioMM, initial values are computed using approximate expected values by setInits and then written to file by dumpInits

Usage

setInits(model, priors, seed = 1)

dumpInits(inits, stem = "test", inits.file = paste(stem, "-inits.R", sep = ""))

Arguments

model
Object of class modelSegratioMM providing model attributes like the number of components and ploidy level
priors
Object of class priorsSegratioMM
seed
Seed to be used for JAGS runs. If a number of chains are to be run a vector of starting values may be specified. However, see note below.
inits
A list of initial values usually produced by setInits
stem
File name stem for inits file (default test)
inits.file
Inits file name which is automatically generated from stem if not specified

Value

  • Returns a list with the following initial values:
  • muMean of dosage classes on logit scale: usually c(0,NA,NA,...,NA)
  • PInitial value for proportion in each dosage class
  • tauPrecision of means which depends on whether priors are strong or weak
  • thetaDifferences in means (for parameterisation employed for better convergence)
  • seedSets seed for each MCMC chain (Default:1)
  • taubIf the model contains a random effect then sets initial value of precision of random effect b which is normally distributed with mean 0 and precision taub

concept

  • segregation ratio
  • dominant marker
  • autopolyploid

See Also

setModel setPriors setControl dumpInits

Examples

Run this code
## simulate small autooctaploid data set
a1 <- sim.autoMarkers(8,c(0.7,0.2,0.1),n.markers=100,n.individuals=50)

## set up model, priors, inits etc and write files for JAGS
x <- setModel(3,8)
x2 <- setPriors(x)
inits <- setInits(x,x2)
dumpInits(inits)

Run the code above in your browser using DataLab