calcStandardErrors function

Standard errors for predictions

Standard errors for predictions

Calculates the standard errors for predictions Du^D \hat{u}, see Welham et al. 2004 and Gilmour et al. 2004 for details.

calcStandardErrors(C, D)

Arguments

  • C: a symmetric matrix of class spam
  • D: a matrix of class spam

Returns

a vector with standard errors for predictions Du^D \hat{u}.

Details

The prediction error variance is given by DC1DD C^{-1} D', where CC is the mixed model coefficient matrix, and DD defines linear combinations of fixed and random effects. The standard errors are given by the the square root of the diagonal. To calculate the standard errors in an efficient way we use that

logC+ξididiξiξi=0=trace(C1didi)=trace(diC1di)=diC1di, \frac{\partial log|C + \xi_i d_i d_i'|}{\partial \xi_i} |_{\xi_i=0}= trace(C^{-1} d_i d_i') =trace(d_i' C^{-1} d_i) = d_i' C^{-1} d_i,

where did_i is row ii of matrix DD. The values of diC1did_i' C^{-1} d_i can be calculated more efficient, avoiding the calculation of the inverse of CC, by using Automated Differentiation of the Choleksy algorithm, see section 2.3 in Smith (1995) for details.

References

Welham, S., Cullis, B., Gogel, B., Gilmour, A., & Thompson, R. (2004). Prediction in linear mixed models. Australian & New Zealand Journal of Statistics, 46(3), 325-347.

Smith, S. P. (1995). Differentiation of the Cholesky algorithm. Journal of Computational and Graphical Statistics, 4(2), 134-147.

Gilmour, A., Cullis, B., Welham, S., Gogel, B., & Thompson, R. (2004). An efficient computing strategy for prediction in mixed linear models. Computational statistics & data analysis, 44(4), 571-586.