dosagesJagsMix: Compute dosages under specified Bayesian mixture model

Description Usage Arguments Value Author(s) See Also Examples

Description

Computes and returns estimated dosages under specified model using posterior probabilities derived from mcmc chains by the proportion of samples in each dosage class.

Usage

1
2
3
dosagesJagsMix(mcmc.mixture, jags.control, seg.ratio, chain = 1,
max.post.prob = TRUE, thresholds = c(0.5, 0.6, 0.7, 0.8, 0.9, 0.95,
0.99), print = FALSE, print.warning = TRUE, index.sample = 20)

Arguments

mcmc.mixture

Object of type segratioMCMC produced by coda usually by using readJags

jags.control

Object of class jagsControl for setting up JAGS command file

seg.ratio

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)

max.post.prob

Logical for producing dose allocations based on the maximum posterior probability (Default: TRUE)

thresholds

Numeric vector of thresholds for allocating dosages when the posterior probabilty to a particular dosage class is above the threshold

print

Logical indicating whether or not to print intermediate results (Default: FALSE)

print.warning

Logical to print warnings if there is more than one marker with the maximum posterior probability

index.sample

Numeric vector indicating which markers to print if print is TRUE. If index.sample is of length 1 then a random sample of size index.sample is selected

Value

An object of class dosagesMCMC is returned with components:

p.dosage

Matrix of posterior probabilities of dosages for each marker dosage

dosage

Matrix of allocated dosages based on posterior probabilities. The columns correspond to different 'thresholds' and if requested, the last column is allocated on basis of max.post

thresholds

vector of cutoff probabilities for dosage class

chain

Chain used to compute dosages

max.post

maximum dosage posterior probabilties for each marker

index.sample

Numeric vector indicating which markers to print if print is TRUE. If index.sample is of length 1 then a random sample of size index.sample is selected

Author(s)

Peter Baker [email protected]

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
27
## 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 produce dosage allocations
xj <- readJags(rj)
dd <- dosagesJagsMix(xj, small, sr)
print(dd)

## End(Not run)

polySegratioMM documentation built on May 2, 2019, 4:41 p.m.