Bayz Manual

Overview of available Bayz-R models

Mixed models

This includes basic mixed models with fixed and uncorrelated random effects, random regression models for genotypes (rrBLUP) or covariates, and mixed model with pedigree.

Basic mixed model (

The call is:

  estmm <-, resp=y, fixmod=f, ranmod=r, chain=c(t,b,s))

Mixed model with additional random regression on genotypes or covariates (bayz.mmg, bayz.mmc)

The call for using genotypes is:

  estmmg <- bayz.mmg(data=d, geno=g, resp=y, fixmod=f, ranmod=r, chain=c(t,b,s))
and for using covariates is:
  estmmc <- bayz.mmc(data=d, covar=c, resp=y, fixmod=f, ranmod=r, chain=c(t,b,s))
The genotypes or covariates in the geno= or covar= table are treated with random regressions (apart from storage and details on missing values the two versions are the same). Additional random effects can still be added using the ranmod= setting. This model is known as the rrBLUP model.

Mixed model with pedigree (bayz.mmp, bayz.mmpr)

The call is:

  estmmp <- bayz.mmp(data=d, ped=p, resp=y, fixmod=f, ranmod=r, chain=c(t,b,s))
Additional uncorrelated random effects can still be added using the ranmod= setting.
There is also a version for replicated phenotypic data, bayz.mmpr, and the arguments are the same. Note: the model for replicated phenotypes fits an additional random effect to allow for additional correlation between the replicated records within ID (Permanent Environment effect for animal data). You should not add an extra ID effect to account for this, as bayz already does it automatically.

Mixed models with one or two G-matrices or G1xG2 interaction (bayz.mmG1/G2/G3)

The standard model known as GBLUP is bayz.mmG1:

  estmmG1 <- bayz.mmG1(data=d, resp=y, fixmod=f, ranmod=r, G=gmat, mineval=0.001, chain=c(t,b,s))
where with argument G= a G-matrix is given. Note: as for other data-tables in Rbayz, this needs to have a first column with IDs! The model automatically includes an ID with G-matrix covariance structure, the ranmod= should be used for any additional random effects.
The fit of the GBLUP model is based on fitting eigen-vectors of the G-matrix by random regression, and the argument mineval= sets a minimum eigen-value to retain eigen-vectors. As a result bayz.mmG1 will also work fine on singular G-matrices, because it simply drops the eigen-vectors with very small eigen-value from the fit.

Two more models are available:

  estmmG2 <- bayz.mmG2(data=d, resp=y, fixmod=f, ranmod=r, G1=gmat1, G2=gmat2, mineval=0.001, chain=c(t,b,s))
  estmmG3 <- bayz.mmG2(data=d, resp=y, fixmod=f, ranmod=r, G1=gmat1, G2=gmat2, mineval=0.001, chain=c(t,b,s))
where bayz.mmG2 fits two G-matrices (a model that is for instance useful to fit a genomic feature model), and bayz.mmG3 that also fits two G-matrices with an additional correlation between the G-matrices (this is an experimental version).
Additionally, there are repeat-version for all three models: bayz.mmG1r, bayz.mmG2r, bayz.mmG3r.

Power LASSO models (bayz.bplg, bayz.bplc, bayz.bplcr)

There is a version using genotypes (bayz.bplg), or using covariates (bayz.bplc), and a version for repeated phenotypes using covariates per ID (bayz.bplcr).
The call for bayz.bplg is:

  estbplg <- bayz.bplg(data=d, geno=g, resp=y, fixmod=f, ranmod=r, pow=0.5, chain=c(t,b,s))
The call is the same as bayz.mmg, except for an added pow= setting, which sets the power parameter for the Power LASSO model. The default is pow=0.5, a setting pow=1 makes the standard LASSO, pow=2 makes the rrBLUP model (but less efficient). Usually, pow is used in the range 0.3-0.7 to make a distribution which is more peaked and has longer tails than the standard LASSO.

The call for bayz.bplc replaces geno= with covar= table, similar as difference between bayz.mmg and bayz.mmc.
The call for bayz.bplcr is the same is bayz.bplc but allows replicated phenotypes. It fits an additional ID variance (see bayz.mmp comments).

Bayesian Variable Selection models (bayz.bvs1g, bayz.bvs1c, bayz.bvs1cr)

The bvs1 models are an implementation of BayesCpi, with a 2-class mixture model and estimated proportions (pi) for SNPs with small and large effects. In the bayz version, variance between small and large SNP effects have a fixed ratio.
The call for bayz.bvs1g (version with genotypes) is:

  estbvs1g <- bayz.bvs1g(data=d, geno=g, resp=y, fixmod=f, ranmod=r, piprior=c(100,1), varratio=100, chain=c(t,b,s))
The additional parameters for bvs1g are: piprior, which sets the Beta prior distribution to estimate the proportion (pi), it is usually varied between 10,1 to 1000,1 (with default 100,1), which gives prior information to push pi to have most SNPs in the small effect group. A uniform prior on pi is Beta 1,1. The varratio parameter sets the fixed ratio between large and small SNP effects, it usually varied from 10 to 1000, with default 100.

There is also a version for covariate (bayz.bvs1c), and for repeated phenotypes and covariates (bayz.bvs1cr).