deerlab.selregparam¶
- selregparam(y, A, solver, method='aic', algorithm='auto', noiselvl=None, searchrange=[1e-08, 100.0], regop=None, weights=None, full_output=False)[source]¶
Selection of optimal regularization parameter based on a selection criterion.
This function is used to compute the optimal regularization parameter in a linear least squares problem. The regularization parameter can be determined using different methods, which are specified in the
method
parameter. The function accepts multiple datasets and corresponding model matrices, which can be globally evaluated. The optimization of the regularization parameter can be performed using thebrent
algorithm, which is the default, or the slowergrid
search algorithm. The function returns the optimal regularization parameter, and iffull_output
isTrue
, it also returns the regularization parameter candidates, as well as the values of the selection functional, the residual, and penalty norms all evaluated at the different regularization parameter candidates.- Parameters:
- yarray_like or list of array_like
Dataset, multiple datasets can be globally evaluated by passing a list of datasets.
- A2D-array_like or list of 2D-array_like
Model (design) matrix, if a list of datasets is specified, a corresponding list of matrices must be passed as well.
- solvercallable
Linear least-squares solver. Must be a callable function with signature
solver(AtA,Aty)
.- methodstring
Method for the selection of the optimal regularization parameter.
'lr'
- L-curve minimum-radius method (LR)'lc'
- L-curve maximum-curvature method (LC)'cv'
- Cross validation (CV)'gcv'
- Generalized Cross Validation (GCV)'rgcv'
- Robust Generalized Cross Validation (rGCV)'srgcv'
- Strong Robust Generalized Cross Validation (srGCV)'aic'
- Akaike information criterion (AIC)'bic'
- Bayesian information criterion (BIC)'aicc'
- Corrected Akaike information criterion (AICC)'rm'
- Residual method (RM)'ee'
- Extrapolated Error (EE)'ncp'
- Normalized Cumulative Periodogram (NCP)'gml'
- Generalized Maximum Likelihood (GML)'mcl'
- Mallows’ C_L (MCL)
If
'lr'
or'lc'
is specified, the search algorithm is automatically set to'grid'
.- weightsarray_like, optional
Array of weighting coefficients for the individual datasets in global fitting. If not specified all datasets are weighted inversely proportional to their noise levels.
- algorithmstring, optional
Search algorithm:
'auto'
- Automatically, selects algrothium based on the searchrange. If the searchrange has two elements its set to'brent'
otherwise to'grid'
.'grid'
- Grid-search, slow.'brent'
- Brent-algorithm, fast.
The default is
'auto'
.- searchrangelist, optional
Either the search range for the optimization of the regularization parameter with the
'brent'
algorithm. Or if more than two values are specified, then it is interpreted as candidates for the'grid'
algorithm. If not specified the default search range defaults to[1e-8,1e2]
and the'brent'
algorithm.- regop2D array_like, optional
Regularization operator matrix, the default is the second-order differential operator.
- full_outputboolean, optional
If enabled the function will return additional output arguments in a tuple, the default is False.
- nonnegativityboolean, optional
Enforces the non-negativity constraint on computed distance distributions, by default enabled.
- noiselvlfloat scalar, optional
Estimate of the noise standard deviation, if not specified it is estimated automatically. Used for the MCL selection method.
- Returns:
- alphaoptscalar
Optimal regularization parameter.
- alphasndarray
Regularization parameter values candidates evaluated during the search. Returned if full_output is True.
- functionalndarray
Values of the selection functional specified by (method) evaluated during the search. Returned if full_output is True.
- residualsndarray
Values of the residual norms evaluated during the search. Returned if full_output is True.
- penaltiesndarray
Values of the penalty norms evaluated during the search. Returned if full_output is True.