cherab.phix.inversion.GCV#
- class cherab.phix.inversion.GCV(*args, lambdas=None, **kwargs)[source]#
Bases:
SVDInversionBaseGeneralized Cross-Validation (GCV) criterion inversion method inheriting
SVDInversionBaseclass.GCV criterion function represents as follows:
\[GCV(\lambda) := \frac{||Ax_\lambda - b||^2}{\left[1 - \sum_{i=1}^N w_i(\lambda)\right]^2}\]The optimal regularization paramter is estimated at the minimal of GCV.
- Parameters:
s (vector_like) – singular values \(\sigma_i\) in \(s\) vectors.
u (array_like) – SVD left singular vectors forms as one matrix like \(u = (u_1, u_2, ...)\)
vh (array_like) – SVD right singular vectors forms as one matrix like \(vh = (v_1, v_2, ...)^T\)
data (vector_like) – given data for inversion calculation
lambdas (vector_like, optional) – list of regularization parameters to search for optimal one, by default
10 ** numpy.linspace(-5, 5, 100)**kwargs (
SVDInversionBaseproperties, optional) – kwargs are used to specify properties like ainversion_base_vectors
Methods
eta([beta])Calculate squared regularization norm \(\eta = ||L(x - x_0)||^2\)
eta_diff([beta])Calculate differential of
etaby regularization parameter.gcv([beta])Definition of GCV criterion function.
inverted_solution([beta])Calculate the inverted solution using given regularization parameter.
optimize([itemax])Excute the optimization of L-curve regularization.
optimized_solution([itemax])Calculate inverted solution using GCV criterion optimization.
plot_gcv([fig, axes])Plotting GCV vs regularization parameters in log-log scale.
regularization_norm([beta])Return the residual norm \(\sqrt{\eta} = ||L (x - x_0)||\)
residual_norm([beta])Return the residual norm \(\sqrt{\rho} = ||Ax - b||\)
rho([beta])Calculate squared residual norm \(\rho = ||Ax - b||^2\).
w([beta])Calculate window function using regularization parameter as a valuable and using singular values.
Attributes
L_invInversion matrix in the regularization term.
betaRegularization parameter.
dataGiven data for inversion calculation.
List of values of GCV, elements of which are calculated after the optimization iteration.
inversion_base_vectorsThe components of inversions base represented as
L_inv @ vh.T.Optimal regularization parameter which is decided after the optimization iteration.
List of regularization parameters used for the optimization process.
ssingular values \(\sigma_i\) in \(s\) vectors.
uSVD left singular vectors forms as one matrix like \(u = (u_1, u_2, ...)\)
vhSVD right singular vectors forms as one matrix like \(vh = (v_1, v_2, ...)^T\)
- optimize(itemax=3)[source]#
Excute the optimization of L-curve regularization. In particular, this method is used to seek the optimal regularization parameter computing gcv. The optimal regularization parameter corresponds to the index of minimum gcv. This procedure is iterated by up to the itemax times. Every time iterately calculating, the range of regularization parameters is narrowed to FWHM around the minimum gcv point. The optimal regularization parameter is cached to
self._lambda_optwhich can be seenlambda_optproperty. And, bothlambdasandgcvsare updated and stored to each property.- Parameters:
itemax (int) – iteration times, by default 3
- Return type:
None
- optimized_solution(itemax=None)[source]#
Calculate inverted solution using GCV criterion optimization.
- Parameters:
itemax (int | None) – iteration times of optimization method, by default None. if an integer is given,
optimizeis called and optimal lambda is stored inlambda_opt.- Returns:
optimized solution vector
- Return type:
- property gcvs: ndarray[Any, dtype[float64]]#
List of values of GCV, elements of which are calculated after the optimization iteration.