#NEWLINE# def E_logpX( self , SS ) : #NEWLINE# #INDENT# ' E_q [ log p(X | Z, Phi) ]\n    ' #NEWLINE# D = self . D #NEWLINE# lpX = np . zeros ( self . K ) #NEWLINE# for k in range ( self . K ) : #NEWLINE# #INDENT# if ( SS . N [ k ] < 1e-09 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ElogLam_N = ( self . comp [ k ] . E_sumlogLam ( ) * SS . N [ k ] ) #NEWLINE# ELam_S2 = np . inner ( self . comp [ k ] . E_Lam ( ) , SS . xx [ k ] ) #NEWLINE# ELamMu_S = np . inner ( self . comp [ k ] . E_LamMu ( ) , SS . x [ k ] ) #NEWLINE# ELamMu2_N = ( np . sum ( self . comp [ k ] . E_LamMu2 ( ) ) * SS . N [ k ] ) #NEWLINE# lpX [ k ] = ( ElogLam_N - ( ( ELam_S2 - ( 2 * ELamMu_S ) ) + ELamMu2_N ) ) #NEWLINE# #UNINDENT# logNormC = ( ( ( ( - 0.5 ) * D ) * np . sum ( SS . N ) ) * LOGTWOPI ) #NEWLINE# return ( logNormC + ( 0.5 * np . sum ( lpX ) ) )