- GLMGam.select_penweight(criterion='aic', start_params=None, start_model_params=None, method='basinhopping', **fit_kwds)¶
find alpha by minimizing results criterion
The objective for the minimization can be results attributes like
bicwhere the latter are based on effective degrees of freedom.
Warning: In many case the optimization might converge to a local optimum or near optimum. Different start_params or using a global optimizer is recommended, default is basinhopping.
name of results attribute to be minimized. Default is ‘aic’, other options are ‘gcv’, ‘cv’ or ‘bic’.
starting parameters for alpha in the penalization weight minimization. The parameters are internally exponentiated and the minimization is with respect to
starting parameter for the
- method‘basinhopping’, ‘nm’ or ‘minimize’
‘basinhopping’ and ‘nm’ directly use the underlying scipy.optimize functions basinhopping and fmin. ‘minimize’ provides access to the high level interface, scipy.optimize.minimize.
additional keyword arguments will be used in the call to the scipy optimizer. Which keywords are supported depends on the scipy optimization function.
penalization parameter found by minimizing the criterion. Note that this can be only a local (near) optimum.
results returned by the scipy optimization routine. The parameters in the optimization problem are log(alpha)
history of calls to pirls and contains alpha, the fit criterion and the parameters to which pirls converged to for the given alpha.
In the test cases Nelder-Mead and bfgs often converge to local optima, see also https://github.com/statsmodels/statsmodels/issues/5381.
This does not use any analytical derivatives for the criterion minimization.
Status: experimental, It is possible that defaults change if there is a better way to find a global optimum. API (e.g. type of return) might also change.