#NEWLINE# def _psi1computations( variance , lengthscale , Z , mu , S , gamma ) : #NEWLINE# #INDENT# '\n        Z - MxQ\n        mu - NxQ\n        S - NxQ\n        gamma - NxQ\n        ' #NEWLINE# lengthscale2 = np . square ( lengthscale ) #NEWLINE# _psi1_denom = ( ( S [ : , None , : ] / lengthscale2 ) + 1.0 ) #NEWLINE# _psi1_denom_sqrt = np . sqrt ( _psi1_denom ) #NEWLINE# _psi1_dist = ( Z [ None , : , : ] - mu [ : , None , : ] ) #NEWLINE# _psi1_dist_sq = ( np . square ( _psi1_dist ) / ( lengthscale2 * _psi1_denom ) ) #NEWLINE# _psi1_common = ( gamma [ : , None , : ] / ( ( lengthscale2 * _psi1_denom ) * _psi1_denom_sqrt ) ) #NEWLINE# _psi1_exponent1 = ( np . log ( gamma [ : , None , : ] ) - ( ( _psi1_dist_sq + np . log ( _psi1_denom ) ) / 2.0 ) ) #NEWLINE# _psi1_exponent2 = ( np . log ( ( 1.0 - gamma [ : , None , : ] ) ) - ( ( np . square ( Z [ None , : , : ] ) / lengthscale2 ) / 2.0 ) ) #NEWLINE# _psi1_exponent_max = np . maximum ( _psi1_exponent1 , _psi1_exponent2 ) #NEWLINE# _psi1_exponent = ( _psi1_exponent_max + np . log ( ( np . exp ( ( _psi1_exponent1 - _psi1_exponent_max ) ) + np . exp ( ( _psi1_exponent2 - _psi1_exponent_max ) ) ) ) ) #NEWLINE# _psi1_exp_sum = _psi1_exponent . sum ( axis = ( - 1 ) ) #NEWLINE# _psi1 = ( variance * np . exp ( _psi1_exp_sum ) ) #NEWLINE# return _psi1