igma^2) + \log\left|S(\gamma K+ I)S^T\right|\right) - \frac{1}{2\sigma^2} (Sy)^T(S(\gamma K+ I)S^T)^{-1}(Sy)
</script>

<p>Instead of the unknown $\sigma^2$ we put its ML estimate, which is </p>

<script type="math/tex; mode=display">
\frac{1}{N-D}(Sy)^T(S(\gamma K+I)S^T)^{-1}(Sy)
</script>

<p>and get</p>

<script type="math/tex; mode=display">
-\frac12(N-D)\log\left(2\pi\sigma^2\right) - \frac12\log\left|S(\gamma K+ I)S^T\right| - \frac{N-D}{2}
</script>

<p>This expression is used in <code>fastlmm.infere