def Kdiag(self, X):
K_ff = np.zeros(X.shape[<NUM_LIT:0>])<EOL>for i,x in enumerate(X):<EOL><INDENT>K_ff[i] = self.k_ff(x[<NUM_LIT:0>],x[<NUM_LIT:0>],self.lengthscale[<NUM_LIT:0>])<EOL><DEDENT>return K_ff * self.variances[<NUM_LIT:0>]<EOL>
I've used the fact that we call this method during prediction (instead of K). When we
        do prediction we want to know the covariance between LATENT FUNCTIONS (K_ff) (as that's probably
        what the user wants).
        $K_{ff}^{post} = K_{ff} - K_{fx} K_{xx}^{-1} K_{xf}$