choice (int, float, or {'fixed', 'mozorov', 'lcurve'}) – Regularization parameter selection strategy:
- If int or float: fixed regularization parameter value.
- ‘fixed’: use a fixed parameter value (must provide parameter).
- ‘mozorov’: use Morozov’s discrepancy principle.
- ‘lcurve’: use L-curve criterion.
parameter (float, optional) – Fixed regularization parameter value (required if choice=’fixed’).
Solve the linear system using Tikhonov regularization.
Parameters:
K (numpy.ndarray) – Coefficient matrix (kernel) with shape (M, N).
y (numpy.ndarray) – Right-hand side vector or matrix with shape (M,) or (M, P).
Returns:
Solution vector or matrix with shape (N,) or (N, P).
Return type:
numpy.ndarray
Notes
The solution is computed as:
- For fixed parameter: \(x = (K^*K + \alpha I)^{-1}K^*y\)
- For Morozov: automatically selects \(\alpha\) using discrepancy principle
- For L-curve: automatically selects \(\alpha\) using L-curve criterion
eispy2d.regularization.regularization.conjugated_gradient(K, y, iterations)#
Perform the Conjugated-Gradient (CG) regularization.
Solve the linear ill-posed system through CG regularization [1]_.
Parameters:
K (numpy.ndarray) – The coefficient matrix (kernel).
y (numpy.ndarray) – The right-hand-side array.
iterations (int) – Number of iterations.
Returns:
The regularized solution vector.
Return type:
numpy.ndarray
References
eispy2d.regularization.regularization.landweber(K, y, x, iterations)#
Perform the Landweber regularization.
Solve the linear ill-posed system through Landweber regularization
[1]_. The algorithm formula is:
\[x_{n+1} = x_n + a K^*(y - K x_n)\]
Parameters:
K (numpy.ndarray) – The coefficient matrix (kernel).
y (numpy.ndarray) – The right-hand-side array.
x (numpy.ndarray) – Initial guess for the solution.
iterations (int) – Number of iterations.
Returns:
The regularized solution vector.
Return type:
numpy.ndarray
References
eispy2d.regularization.regularization.lcurve_choice(K, y, bounds=(-20,0), number_terms=21)#
Determine the regularization parameter through L-curve.
The regularization parameter is determined according to the L-curve.
The L-curve is the graph between error and solution norms. The
values are normalized and the chosen point is the one in which its
distance from (0, 0) is minimum.
Parameters:
K (numpy.ndarray) – Coefficient matrix (kernel).
y (numpy.ndarray) – Right-hand-side array.
bounds (2-tuple, default: (-20, 0)) – Minimum and maximum value of the exponential form of the
regularization parameter (log10 scale).
number_terms (int, default: 21) – Number of samples on the L-curve.
Returns:
Optimal regularization parameter \(\alpha\).
Return type:
float
eispy2d.regularization.regularization.least_squares(K, y, cutoff)#
Return the Spectral Cut-off solution to a linear matrix equation.
K (numpy.ndarray) – The coefficient matrix (kernel).
y (numpy.ndarray) – The right-hand-side array.
cutoff (float) – Truncation level (rcond) for singular values.
Returns:
The least squares solution vector.
Return type:
numpy.ndarray
eispy2d.regularization.regularization.mozorov_choice(K, y, delta=0.001)#
Apply the Discrepancy Principle of Morozov [1].
Compute the regularization parameter according to the starting guess
of Newton’s method for solving the Discrepancy Principle of Morozov
defined in [1].
Parameters:
K (numpy.ndarray) – Coefficient matrix (kernel).
y (numpy.ndarray) – Right-hand-side array.
delta (float, default: 1e-3) – Noise level of the problem.
Returns:
Optimal regularization parameter \(\alpha\).
Return type:
float
Notes
The Discrepancy Principle of Morozov is defined according to
the zero of the following monotone function: