setInits {polySegratioMM}R Documentation

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:

mu Mean of dosage classes on logit scale: usually c(0,NA,NA,...,NA)
P Initial value for proportion in each dosage class
tau Precision of means which depends on whether priors are strong or weak
theta Differences in means (for parameterisation employed for better convergence)
seed Sets seed for each MCMC chain (Default:1)
taub If 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

Note

Warning: If a number of chains are to be produced then several seeds may be specified. Currently, this is largely untested and so it is highly unlikely that this will actually work for all functions in this package.

Author(s)

Peter Baker p.baker1@uq.edu.au

See Also

setModel setPriors setControl dumpInits

Examples

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


[Package polySegratioMM version 0.5-2 Index]