View source: R/predictFunctions.R

calcStandardErrors | R Documentation |

Calculates the standard errors for predictions `D \hat{u}`

,
see Welham et al. 2004 and Gilmour et al. 2004 for details.

```
calcStandardErrors(C, D)
```

`C` |
a symmetric matrix of class spam |

`D` |
a matrix of class spam |

The prediction error variance is given by `D C^{-1} D'`

,
where `C`

is the mixed model coefficient matrix, and `D`

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

```
\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 `d_i`

is row `i`

of matrix `D`

. The values of
`d_i' C^{-1} d_i`

can be calculated more efficient, avoiding the
calculation of the inverse of `C`

, by using Automated Differentiation
of the Choleksy algorithm, see section 2.3 in Smith (1995) for details.

a vector with standard errors for predictions `D \hat{u}`

.

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.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.