QGpsi: Compute "Psi" (used to compute the additive genetic variance...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/source.R

Description

This function computes the parameter "Psi" which relates the additive genetic variance on the latent scale to the additive genetic variance on the observed scale: Va.obs = (Psi^2) * Va

Usage

1
QGpsi(mu = NULL, var, d.link.inv, predict = NULL, width = 10)

Arguments

mu

Latent intercept estimated from a GLMM (set to 0 if predict is not NULL). (numeric of length 1)

var

Latent total phenotypic variance estimated from a GLMM. Usually, the sum of the estimated variances of the random effects, plus the "residual" variance. (numeric of length 1)

d.link.inv

Derivative of the inverse-link function. (function)

predict

Optional vector of predicted values on the latent scale (i.e. matrix product Xb). The latent predicted values must be computed while only accounting for the fixed effects (marginal to the random effects). (numeric)

width

Parameter for the integral computation. The integral is evaluated from mu - width * sqrt(var) to mu + width * sqrt(var). The default value is 10, which should be sensible for most models. (numeric)

Details

The parameter "Psi" is the average of the derivative of the inverse-link function. The additive genetic variance on the observed scale is linked to the additive genetic variance on the latent scale by : Va.obs = (Psi^2) * Va.lat.

Value

This function yields the "Psi" parameter. (numeric)

Author(s)

Pierre de Villemereuil & Michael B. Morrissey

See Also

QGmvpsi, QGparams, QGpred, QGlink.funcs, QGmean, QGvar.dist, QGvar.exp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Example using binom1.probit model
mu <- 0
va <- 1
vp <- 2
# The inverse-link for a probit is the CDF of a standard Gaussian
# Hence its derivative is the PDF of a standard Gaussian
dinv <- function(x){dnorm(x)}

# Computing Psi
Psi <- QGpsi(mu = 0, var = 2, d.link.inv = dinv)
# Computing additive variance on the observed scale
(Psi^2) * va

# This function is used by QGparams to obtain var.a.obs
QGparams(mu = 0, var.p = vp, var.a = va, model = "binom1.probit")
# Same results as above!

QGglmm documentation built on Jan. 7, 2020, 5:06 p.m.