TIMBR: Tree-based Inference of Multiallelism via Bayesian Regression

Description Usage Arguments Value Examples

View source: R/TIMBR_source.R

Description

Posterior samples and Bayes Factors using the TIMBR model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
TIMBR(
  y,
  prior.D,
  prior.M,
  prior.phi.v = 2,
  samples = 10000,
  Z = NULL,
  W = NULL,
  calc.lnBF = T,
  samples.ml = 1000,
  verbose = T,
  stop.on.error = F
)

Arguments

y

vector of phenotype values for each strain

prior.D

list of inputs for the prior distribution of strain diplotype states; see data(mcv.data) for an example

prior.M

list of inputs for the prior distribution of the allelic series model; see data(mcv.data) for examples

prior.phi.v

degrees of freedom for the half-t prior distribution on the variance component

samples

number of samples to draw from the full posterior

Z

design matrix for intercept and covariates; first column must be a vector of ones, which is the default

W

vector of replicates for each strain; one replicate per strain by default

calc.lnBF

option to calculate the lnBF, which is often computationally demanding

samples.ml

number of samples to draw from the conditional posterior (if necessary) when calc.lnBF=T

verbose

optionally report function progress

stop.on.error

stop function if error is encountered when using 'integrate'. errors related to roundoff and small values may occur during edge cases

Value

a list of input parameters, posterior samples and marginal densities, and the marginal likelihood

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#example data
data(mcv.data)
str(mcv.data)

#call TIMBR using CRP
results <- TIMBR(mcv.data$y, mcv.data$prior.D, mcv.data$prior.M$crp)

#report the Bayes Factor
results$ln.BF

#report posterior probabilities for the top allelic series models
head(results$p.M.given.y)

#report mean posterior haplotype effects
colMeans(results$post.hap.effects)

wesleycrouse/TIMBR documentation built on Feb. 19, 2021, 7:31 a.m.