jagsAMmv: Animal model (multivariate)

View source: R/quantgen.R

jagsAMmvR Documentation

Animal model (multivariate)

Description

Given T traits, I genotypes, Q covariates and N=I*Q phenotypes per trait, fit an "animal model" with the rstan package via the following likelihood: Y = W C + Z G_A + Z G_D + E, where Y is NxT; W is NxQ; Z is NxI; G_A ~ Normal_IxT(0, A, V_G_A) with A the known matrix of additive genetic relationships; G_D ~ Normal_IxT(0, D, V_G_D) with D the known matrix of dominant genetic relationships; E ~ Normal_NxT(0, Id_N, V_E); Missing phenotypes are jointly imputed with the other unknown variables, and the errors can follow a Student's t distribution to handle outliers.

Usage

jagsAMmv(
  data,
  relmat,
  inits = NULL,
  nb.chains = 1,
  nb.adapt = 10^3,
  burnin = 10^2,
  nb.iters = 10^3,
  thin = 10,
  progress.bar = NULL,
  rm.jags.file = TRUE,
  verbose = 0
)

Arguments

data

data.frame containing the data corresponding to relmat; should have columns grep-able for "response" as well as a column "geno.add" used with matrix A; if a column "geno.dom" exists, it will be used with matrix D; any other column will be interpreted as corresponding to "fixed effects"

relmat

list containing the matrices of genetic relationships (see estimGenRel); additive relationships (matrix A) are compulsory, with name "geno.add"; dominant relationships (matrix D) are optional, with name "geno.dom"; can be in the "matrix" class (base) or the "dsCMatrix" class (Matrix package)

inits

list of initial values (possible to use 1 sub-list per chain, see jags.model); if NULL, JAGS will choose typical values (usually mean, median, or mode of the prior)

nb.chains

number of independent chains to run (see jags.model)

nb.adapt

number of iterations for adaptation (see jags.model)

burnin

number of initial iterations to discard (see the update function of the rjags package)

nb.iters

number of iterations to monitor (see coda.samples)

thin

thinning interval for monitored iterations (see coda.samples)

progress.bar

type of progress bar (text/gui/none or NULL)

rm.jags.file

remove the file specifying the model written in the JAGS-dialect of the BUGS language

verbose

verbosity level (0/1)

Author(s)

Timothee Flutre, inspired by code from Najla Saad Elhezzani (arXiv:1507.08638)

See Also

jagsAM


timflutre/rutilstimflutre documentation built on Feb. 12, 2025, 11:35 p.m.