View source: R/constraints_utils.R
| clip_psd | R Documentation |
Spectral clip: eigen-decompose and set negative eigenvalues to
zero. Unlike ensure_spd() (a diagonal ridge shift), this preserves the
non-negative part of the spectrum exactly. The output has no negative
eigenvalue beyond reconstruction roundoff: the only fast path is an exact
(unshifted) Cholesky success, which proves positive definiteness. Requires a dense
eigendecomposition, so large sparse matrices are refused.
clip_psd(M, tol = NULL, dense_maxn = 2000L, name = "M")
M |
numeric matrix or Matrix::Matrix |
tol |
unused; kept for call compatibility |
dense_maxn |
refuse sparse input larger than this (clip densifies) |
name |
label used in error messages |
a symmetric Matrix, PSD
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.