CholeskyDecomposition

CholeskyDecomposition

A stored Cholesky decomposition of a symmetric positive-definite matrix, supporting incremental O(n²) growth via insertColumn (used by GaussianProcess.addSamples). Mirrors nalgebra's Cholesky object that friedrich keeps inside the GP.

Constructor

new CholeskyDecomposition(A, epsilonopt)

Description:
  • Build from a symmetric positive-definite matrix.

Source:
Parameters:
Name Type Attributes Default Description
A Array.<Array.<number>>
epsilon number | null <optional>
null

null → throw on failure; positive → substitute mode.

Classes

CholeskyDecomposition

Members

_L :Array.<Array.<number>>

Description:
  • lower-triangular factor L (A = L·Lᵀ)

Source:

lower-triangular factor L (A = L·Lᵀ)

Type:
  • Array.<Array.<number>>

_epsilon :number|null

Source:
Type:
  • number | null

Methods

insertColumn(colIndex, newColumn) → {this}

Description:
  • Insert a row/column at position colIndex, yielding the (n+1)×(n+1) decomposition. In friedrich colIndex is always the old dimension (i.e. appended at the end), so this implements the standard "bordering" update:

    L' = [ L 0 ] with L · l21 = v[0..n] (lower-tri solve) [ l21ᵀ l22 ] l22 = sqrt(v[n] − l21·l21)

    where v = newColumn (length n+1): v[0..n] are covariances with the existing rows and v[n] is the new point's self-covariance (already including noise²).

    If l22² ≤ 0 and an epsilon was configured, substitute epsilon for the pivot (matches the substitute behaviour of the batch Cholesky).

    Updates this object in place and returns this.

Source:
Parameters:
Name Type Description
colIndex number

must equal the current dimension (end insertion)

newColumn Array.<number>

length colIndex+1

Returns:
Type
this

inverse() → {Array.<Array.<number>>}

Description:
  • Inverse A⁻¹.

Source:
Returns:
Type
Array.<Array.<number>>

l() → {Array.<Array.<number>>}

Description:
  • Lower-triangular factor L.

Source:
Returns:
Type
Array.<Array.<number>>

solve(B) → {Array.<number>|Array.<Array.<number>>}

Description:
  • Solve A·X = B (B: number[] | number[][]), same shape out. Equivalent to choleskySolve(this.l(), B).

Source:
Parameters:
Name Type Description
B Array.<number> | Array.<Array.<number>>
Returns:
Type
Array.<number> | Array.<Array.<number>>

solveLower(B) → {Array.<number>|Array.<Array.<number>>}

Description:
  • Solve L·X = B (forward substitution only). Equivalent to solveLowerTri(this.l(), B).

Source:
Parameters:
Name Type Description
B Array.<number> | Array.<Array.<number>>
Returns:
Type
Array.<number> | Array.<Array.<number>>