def _compute_B_statistics(self, K, W, log_concave, *args, **kwargs):
if not log_concave:<EOL><INDENT>W = np.clip(W, <NUM_LIT>, <NUM_LIT>)<EOL><DEDENT>if np.any(np.isnan(W)):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>W_12 = np.sqrt(W)<EOL>B = np.eye(K.shape[<NUM_LIT:0>]) + W_12*K*W_12.T<EOL>L = jitchol(B)<EOL>LiW12, _ = dtrtrs(L, np.diagflat(W_12), lower=<NUM_LIT:1>, trans=<NUM_LIT:0>)<EOL>K_Wi_i = np.dot(LiW12.T, LiW12) <EOL>C = np.dot(LiW12, K)<EOL>Ki_W_i = K - C.T.dot(C)<EOL>I_KW_i = np.eye(K.shape[<NUM_LIT:0>]) - np.dot(K, K_Wi_i)<EOL>logdet_I_KW = <NUM_LIT:2>*np.sum(np.log(np.diag(L)))<EOL>return K_Wi_i, logdet_I_KW, I_KW_i, Ki_W_i<EOL>
Rasmussen suggests the use of a numerically stable positive definite matrix B
Which has a positive diagonal elements and can be easily inverted

:param K: Prior Covariance matrix evaluated at locations X
:type K: NxN matrix
:param W: Negative hessian at a point (diagonal matrix)
:type W: Vector of diagonal values of Hessian (1xN)
:returns: (W12BiW12, L_B, Li_W12)