def _psi1computations(variance, lengthscale, Z, mu, S, gamma):
        # here are the "statistics" for psi1
        # Produced intermediate results:
        # _psi1                NxM

        lengthscale2 = np.square(lengthscale)

        # psi1
        _psi1_denom = S[:, None, :] / lengthscale2 + 1.  # Nx1xQ
        _psi1_denom_sqrt = np.sqrt(_psi1_denom) #Nx1xQ
        _psi1_dist = Z[None, :, :] - mu[:, None, :]  # NxMxQ
        _psi1_dist_sq = np.square(_psi1_dist) / (lengthscale2 * _psi1_denom) # NxMxQ
        _psi1_common = gamma[:,None,:] / (lengthscale2*_psi1_denom*_psi1_denom_sqrt) #Nx1xQ
        _psi1_exponent1 = np.log(gamma[:,None,:]) - (_psi1_dist_sq + np.log(_psi1_denom))/2. # NxMxQ
        _psi1_exponent2 = np.log(1.-gamma[:,None,:]) - (np.square(Z[None,:,:])/lengthscale2)/2. # NxMxQ
        _psi1_exponent_max = np.maximum(_psi1_exponent1,_psi1_exponent2)
        _psi1_exponent = _psi1_exponent_max+np.log(np.exp(_psi1_exponent1-_psi1_exponent_max) + np.exp(_psi1_exponent2-_psi1_exponent_max)) #NxMxQ
        _psi1_exp_sum = _psi1_exponent.sum(axis=-1) #NxM
        _psi1 = variance * np.exp(_psi1_exp_sum) # NxM

        return _psi1
Init of covariance.
dataset/ETHPy150Open SheffieldML/GPy/GPy/kern/src/psi_comp/ssrbf_psi_comp.py/_psi1computations--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/cov.py/Covariance.__init__