pub fn tikhonov_regularization<F>(
a: &ArrayView2<'_, F>,
lambda: F,
identity_like: bool,
) -> LinalgResult<Array2<F>>
Expand description
Compute Tikhonov regularization of a matrix.
Tikhonov regularization adds a ridge term to improve conditioning: A_reg = A + λI
§Arguments
a
- Input matrixlambda
- Regularization parameteridentity_like
- Whether to add λI (true) or λ times identity-like term
§Returns
- Regularized matrix
§Examples
use scirs2_core::ndarray::array;
use scirs2_linalg::matrix_functions::tikhonov_regularization;
let a = array![[1.0_f64, 0.5], [0.5, 1.0]];
let reg_a = tikhonov_regularization(&a.view(), 0.1, true).unwrap();