#NEWLINE# def loglike( self , loglikelihood_burn = None , **kwargs ) : #NEWLINE# #INDENT# '\n        Calculate the loglikelihood associated with the statespace model.\n\n        Parameters\n        ----------\n        loglikelihood_burn : int, optional\n            The number of initial periods during which the loglikelihood is not\n            recorded. Default is 0.\n        **kwargs\n            Additional keyword arguments to pass to the Kalman filter. See\n            `KalmanFilter.filter` for more details.\n\n        Returns\n        -------\n        loglike : float\n            The joint loglikelihood.\n        ' #NEWLINE# if self . memory_no_likelihood : #NEWLINE# #INDENT# raise RuntimeError ( 'Cannot compute loglikelihood if MEMORY_NO_LIKELIHOOD option is selected.' ) #NEWLINE# #UNINDENT# if ( loglikelihood_burn is None ) : #NEWLINE# #INDENT# loglikelihood_burn = self . loglikelihood_burn #NEWLINE# #UNINDENT# kwargs [ 'results' ] = 'loglikelihood' #NEWLINE# return np . sum ( self . filter ( ** kwargs ) [ loglikelihood_burn : ] )