K+ I| - \frac12\log\left|X^T(\gamma K+ I)^{-1}X\right| +\frac12\log\left|X^TX\right| - \frac{N-D}{2}
</script>

<p>Compare with this line from <code>fastlmm.inference.lmm</code>:</p>

<div class="highlight"><pre><code class="language-python" data-lang="python"><span class="n">nLL</span> <span class="o">=</span>  <span class="mf">0.5</span> <span class="o">*</span> <span class="p">(</span> <span class="n">logdetK</span> <span class="o">+</span> <span class="n">logdetXKX</span> <span class="o">-</span> <span 