#NEWLINE# def marginal_likelihood( self , data ) : #NEWLINE# #INDENT# '\n        Compute marginal likelihood with the given values of omega\n        :param augmented_data:\n        :return:\n        ' #NEWLINE# mll = 0 #NEWLINE# M = data [ 'M' ] #NEWLINE# Z = data [ 'Z' ] #NEWLINE# omega = data [ 'omega' ] #NEWLINE# kappa = data [ 'kappa' ] #NEWLINE# Cvv = self . kernel . K ( Z , Z ) #NEWLINE# Cvv += np . diag ( ( 1e-06 * np . ones ( M ) ) ) #NEWLINE# for k in xrange ( ( self . K - 1 ) ) : #NEWLINE# #INDENT# sys . stdout . write ( '.' ) #NEWLINE# sys . stdout . flush ( ) #NEWLINE# Cvvpo = ( Cvv + np . diag ( omega [ : , k ] ) ) #NEWLINE# Lvvpo = np . linalg . cholesky ( Cvvpo ) #NEWLINE# y = ( ( kappa [ : , k ] / omega [ : , k ] ) - self . mu [ k ] ) #NEWLINE# x1 = solve_triangular ( Lvvpo , y , lower = True ) #NEWLINE# x2 = solve_triangular ( Lvvpo . T , x1 , lower = False ) #NEWLINE# mll += ( ( - 0.5 ) * y . T . dot ( x2 ) ) #NEWLINE# mll += np . linalg . slogdet ( Cvvpo ) [ 1 ] #NEWLINE# mll += ( ( ( - M ) / 2.0 ) * np . log ( ( 2 * np . pi ) ) ) #NEWLINE# #UNINDENT# return mll