#NEWLINE# def Kdiag( self , X ) : #NEWLINE# #INDENT# vyt = self . variance_Yt #NEWLINE# lyt = ( 1.0 / ( 2 * self . lengthscale_Yt ) ) #NEWLINE# a = ( - X . a ) #NEWLINE# c = self . c #NEWLINE# k1 = ( ( 2 * lyt ) * vyt ) #NEWLINE# Kdiag = np . zeros ( X . shape [ 0 ] ) #NEWLINE# slices = index_to_slices ( X [ : , ( - 1 ) ] ) #NEWLINE# for ( i , ss1 ) in enumerate ( slices ) : #NEWLINE# #INDENT# for s1 in ss1 : #NEWLINE# #INDENT# if ( i == 0 ) : #NEWLINE# #INDENT# Kdiag [ s1 ] += vyt #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( i == 1 ) : #NEWLINE# #INDENT# Kdiag [ s1 ] += ( ( k1 + vyt ) + self . ubias ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'invalid input/output index' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return Kdiag