Analytical Leave-one-out prediction variance for Kriging I make extensive use of Kriging (Gaussian Process regression) methods in my work especially using the leave-one-out error calculation that you can get from the Gram matrix.
Background:
To compute the LOOCV error estimate without brute-force solving $N$ equations, you can do the following:
Briefly, following from J. D. Martin and T. W. Simpson. Use of Kriging Models to Approximate Deterministic Computer Models. AIAA journal, 43(4):853–863, 2005, especially Eq 20 (and thereabouts):
Let $F$ be the Vandermond matrix of the polynomial trend function. Let $K$ be the Gram matrix (ie. the kernel evaluated at the construction points) and let $K^{-1}$ be its inverse. Let $c$ be the polynomial coefficients. Let $f$ be the construction values. Define:
$$
Q = 
\begin{pmatrix}
\frac{1}{K^{-1}_{1,1}} &    & 0 \\\ 
 & \ddots &  \\\
0 & & \frac{1}{K_{N,N}^{-1}}
\end{pmatrix}
$$
then,
$$
e = Q\left ( K^{-1}Fc - K^{-1}f \right )
$$
and then the total error is
$$
    E = \frac{||e||}{\sqrt{N}}
$$
or
$$
    E_{rel} = \frac{||e||}{||f||}
$$
My Question
I make extensive use of $E$ as a general error estimate and even more so, $e$ as a point-wise estimate of the error. Both have proven to be very useful and insightful.
But for Kriging, I would also like to examine not the error but how well its prediction uncertainty bounds the error. I can obviously do this with brute force but I suspect there is a similar treatment as above to get the prediction variance.
Does anyone know of it or can they point me in the right direction?
Thanks!
Similar Questions
I note that 156161 also asks about the LOOCV but they are asking about noise and not the prediction variance. The referenced Dubrule 1983 paper was also very informative about the above equations but did not answer the prediction variance question.

After a lot more reading into other answers including the aforementioned Dubrule 1983 [1], the answer is actually that the prediction variance is just the diagonal of $Q$. See [1] eq 8. I also numerically tested this and it works to about 1e-5 error (so more than machine precision but reasonable)
I hope this helps someone else!
[1] O. Dubrule. Cross validation of kriging in a unique neighborhood. Journal of the International Association for Mathematical Geology, 15(6):687–699, 1983.
