''

def _updateloglike(self, params, xi10, ntrain, penalty, upperbounds, lowerbounds, F, A, H, Q, R, history):

    paramsorig = params
    if penalty:
        params = np.min((np.max((lowerbounds, params), axis=0), upperbounds), axis=0)
    if ((F != None) and callable(F)):
        F = F(params)
    elif (F == None):
        F = 0
    if ((A != None) and callable(A)):
        A = A(params)
    elif (A == None):
        A = 0
    if ((H != None) and callable(H)):
        H = H(params)
    elif (H == None):
        H = 0
    print(callable(Q))
    if ((Q != None) and callable(Q)):
        Q = Q(params)
    elif (Q == None):
        Q = 0
    if ((R != None) and callable(R)):
        R = R(params)
    elif (R == None):
        R = 0
    X = self.exog
    if (X == None):
        X = 0
    y = self.endog
    loglike = kalmanfilter(F, A, H, Q, R, y, X, xi10, ntrain, history)
    if penalty:
        loglike += (penalty * np.sum(((paramsorig - params) ** 2)))
    return loglike
