rapid_models.gp_diagnostics.utils.linalg

Module Contents

Functions

triang_solve(A, B, lower=True, trans=False)

Wrapper for lapack dtrtrs function

mulinv_solve(F, B, lower=True)

Solve A*X = B where A = F*F^{T}

mulinv_solve_rev(F, B, lower=True)

Reversed version of mulinv_solve

symmetrify(A, upper=False)

Create symmetric matrix from triangular matrix

chol_inv(L)

Return inverse of matrix A = L*L.T where L is lower triangular

traceprod(A, B)

Calculate trace(A*B) for two matrices A and B

try_chol(K, noise_variance, fun_name)

Try to compute the Cholesky decomposition of (K + noise_variance*I), and print an error message if it does not work

rapid_models.gp_diagnostics.utils.linalg.triang_solve(A, B, lower=True, trans=False)[source]

Wrapper for lapack dtrtrs function DTRTRS solves a triangular system of the form

A * X = B or A**T * X = B,

where A is a triangular matrix of order N, and B is an N-by-NRHS matrix. A check is made to verify that A is nonsingular. :param A: Matrix A(triangular) :param B: Matrix B :param lower: is matrix lower (true) or upper (false) :param trans: calculate A**T * X = B (true) or A * X = B (false)

Returns

Solution to A * X = B or A**T * X = B

rapid_models.gp_diagnostics.utils.linalg.mulinv_solve(F, B, lower=True)[source]

Solve A*X = B where A = F*F^{T}

lower = True -> when F is LOWER triangular. This gives faster calculation

rapid_models.gp_diagnostics.utils.linalg.mulinv_solve_rev(F, B, lower=True)[source]

Reversed version of mulinv_solve

Solves X*A = B where A = F*F^{T}

lower = True -> when F is LOWER triangular. This gives faster calculation

rapid_models.gp_diagnostics.utils.linalg.symmetrify(A, upper=False)[source]

Create symmetric matrix from triangular matrix

rapid_models.gp_diagnostics.utils.linalg.chol_inv(L)[source]

Return inverse of matrix A = L*L.T where L is lower triangular Uses LAPACK function dpotri

rapid_models.gp_diagnostics.utils.linalg.traceprod(A, B)[source]

Calculate trace(A*B) for two matrices A and B

rapid_models.gp_diagnostics.utils.linalg.try_chol(K, noise_variance, fun_name)[source]

Try to compute the Cholesky decomposition of (K + noise_variance*I), and print an error message if it does not work