def psicomputations(variance, Z, variational_posterior, return_psi2_n=False):
<EOL>mu = variational_posterior.mean<EOL>S = variational_posterior.variance<EOL>gamma = variational_posterior.binary_prob<EOL>psi0 = (gamma*(np.square(mu)+S)*variance).sum(axis=-<NUM_LIT:1>)<EOL>psi1 = np.inner(variance*gamma*mu,Z)<EOL>psi2 = np.inner(np.square(variance)*(gamma*((<NUM_LIT:1>-gamma)*np.square(mu)+S)).sum(axis=<NUM_LIT:0>)*Z,Z)+tdot(psi1.T)<EOL>return psi0, psi1, psi2<EOL>
Compute psi-statistics for ss-linear kernel