code: def moments_match_ep(self, data_i, tau_i, v_i, Y_metadata_i=None):
          
          sigma2_hat = 1./(1./self.variance + tau_i)
          mu_hat = sigma2_hat*(data_i/self.variance + v_i)
          sum_var = self.variance + 1./tau_i
          Z_hat = 1./np.sqrt(2.*np.pi*sum_var)*np.exp(-.5*(data_i - v_i/tau_i)**2./sum_var)
          return Z_hat, mu_hat, sigma2_hat
docs: Moments match of the marginal approximation in EP algorithm
  
          :param i: number of observation (int)
          :param tau_i: precision of the cavity distribution (float)
          :param v_i: mean/variance of the cavity distribution (float)