dora/regressors/gp/linalg.py
def jitchol(X, overwrite_a = False, check_finite = True):

    """Add jitter until a positive definite matrix occurs"""
    n = X.shape[0]
    I = np.eye(n)
    jitter = 1e-8
    max_jitter = 1e10
    L = None
    X_dash = X

    while jitter < max_jitter:
        try:
            L = la.cholesky(X_dash, lower = True, 
                overwrite_a = overwrite_a, check_finite = check_finite)
            break
        except la.LinAlgError:
            X_dash = X + jitter * I
            jitter *= 2.0
            log.warning('Jitter added. Amount: %f!' % jitter)

    if jitter > 1e-2:
        log.warning('Rather large jitchol of %f!' % jitter)

    if L is not None:
        return L
    else:
        raise la.LinAlgError("Max value of jitter reached")
Add jitter until a positive definite matrix occurs
Add jitter until a positive definite matrix occurs
Add jitter until a positive definite matrix occurs
def jitchol(X, overwrite_a = False, check_finite = True):
    n = X.shape[0]
    I = np.eye(n)
    jitter = 1e-8
    max_jitter = 1e10
    L = None
    X_dash = X
    while jitter < max_jitter:
        try:
            L = la.cholesky(X_dash, lower = True, 
                overwrite_a = overwrite_a, check_finite = check_finite)
            break
        except la.LinAlgError:
            X_dash = X + jitter * I
            jitter *= 2.0
            log.warning('Jitter added. Amount: %f!' % jitter)
    if jitter > 1e-2:
        log.warning('Rather large jitchol of %f!' % jitter)
    if L is not None:
        return L
    else:
        raise la.LinAlgError("Max value of jitter reached")
def jitchol ( X , overwrite_a = False , check_finite = True ) : n = X . shape [ 0 ] I = np . eye ( n ) jitter = 1e-8 max_jitter = 1e10 L = None X_dash = X while jitter < max_jitter : try : L = la . cholesky ( X_dash , lower = True , overwrite_a = overwrite_a , check_finite = check_finite ) break except la . LinAlgError : X_dash = X + jitter * I jitter *= 2.0 log . warning ( 'Jitter added. Amount: %f!' % jitter ) if jitter > 1e-2 : log . warning ( 'Rather large jitchol of %f!' % jitter ) if L is not None : return L else : raise la . LinAlgError ( "Max value of jitter reached" )
Add jitter until a positive definite matrix occurs
Add jitter until a positive definite matrix occurs
"""Add jitter until a positive definite matrix occurs"""
X
overwrite_a
check_finite