Compute "Psi" (used to compute the additive genetic variance on the observed scale).
Compute "Psi" (used to compute the additive genetic variance on the observed scale).
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
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.
Returns
This function yields the "Psi" parameter. (numeric)
## Example using binom1.probit modelmu <-0va <-1vp <-2# The inverse-link for a probit is the CDF of a standard Gaussian# Hence its derivative is the PDF of a standard Gaussiandinv <-function(x){dnorm(x)}# Computing PsiPsi <- 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.obsQGparams(mu =0, var.p = vp, var.a = va, model ="binom1.probit")# Same results as above!