def _psi2computations(dL_dpsi2, variance, Z, mu, S, gamma):
<EOL>mu2 = np.square(mu)<EOL>gamma2 = np.square(gamma)<EOL>variance2 = np.square(variance)<EOL>mu2S = mu2+S <EOL>gvm = gamma*mu*variance<EOL>common_sum = gvm.dot(Z.T)<EOL>Z_expect = (np.dot(dL_dpsi2,Z)*Z).sum(axis=<NUM_LIT:0>)<EOL>Z_expect_var2 = Z_expect*variance2<EOL>dL_dpsi2T = dL_dpsi2+dL_dpsi2.T<EOL>common_expect = common_sum.dot(dL_dpsi2T).dot(Z)<EOL>Z2_expect = common_sum.dot(dL_dpsi2T)<EOL>Z1_expect = dL_dpsi2T.dot(Z)<EOL>dL_dvar = variance*Z_expect*<NUM_LIT>*(gamma*mu2S-gamma2*mu2).sum(axis=<NUM_LIT:0>)+(common_expect*gamma*mu).sum(axis=<NUM_LIT:0>)<EOL>dL_dgamma = Z_expect_var2*(mu2S-<NUM_LIT>*gamma*mu2)+common_expect*mu*variance<EOL>dL_dmu = Z_expect_var2*mu*<NUM_LIT>*(gamma-gamma2) + common_expect*gamma*variance<EOL>dL_dS = gamma*Z_expect_var2<EOL>dL_dZ = (gamma*(mu2S-gamma*mu2)).sum(axis=<NUM_LIT:0>)*variance2*Z1_expect+ Z2_expect.T.dot(gamma*mu)*variance<EOL>return dL_dvar, dL_dgamma, dL_dmu, dL_dS, dL_dZ<EOL>
Z - MxQ
mu - NxQ
S - NxQ
gamma - NxQ