chol_inv_jitter: Inverse a matrix using an adaptive jitter term

View source: R/kernel-to-matrices.R

chol_inv_jitterR Documentation

Inverse a matrix using an adaptive jitter term

Description

Inverse a matrix from its Choleski decomposition. If (nearly-)singular, increase the order of magnitude of the jitter term added to the diagonal until the matrix becomes non-singular.

Usage

chol_inv_jitter(mat, pen_diag)

Arguments

mat

A matrix, possibly singular.

pen_diag

A number, a jitter term to add on the diagonal.

Value

A matrix, inverse of mat plus an adaptive jitter term added on the diagonal.

Examples

TRUE

MagmaClustR documentation built on June 29, 2024, 1:06 a.m.