def METHOD_NAME(self, method=None, trim=None, **kwds):
    """minimize negative penalized log-likelihood
    Parameters
    ----------
    method : None or str
        Method specifies the scipy optimizer as in nonlinear MLE models.
    trim : {bool, float}
        Default is False or None, which uses no trimming.
        If trim is True or a float, then small parameters are set to zero.
        If True, then a default threshold is used. If trim is a float, then
        it will be used as threshold.
        The default threshold is currently 1e-4, but it will change in
        future and become penalty function dependent.
    kwds : extra keyword arguments
        This keyword arguments are treated in the same way as in the
        fit method of the underlying model class.
        Specifically, additional optimizer keywords and cov_type related
        keywords can be added.
    """
    # If method is None, then we choose a default method ourselves
    # TODO: temporary hack, need extra fit kwds
    # we need to rule out fit methods in a model that will not work with
    # penalization
    from statsmodels.gam.generalized_additive_model import GLMGam
    from statsmodels.genmod.generalized_linear_model import GLM
    # Only for fit methods supporting max_start_irls
    if isinstance(self, (GLM, GLMGam)):
        kwds.update({'max_start_irls': 0})
    # currently we use `bfgs` by default
    if method is None:
        method = 'bfgs'
    if trim is None:
        trim = False
    res = super(PenalizedMixin, self).METHOD_NAME(method=method, **kwds)
    if trim is False:
        # note boolean check for "is False", not "False_like"
        return res
    else:
        if trim is True:
            trim = 1e-4  # trim threshold
        # TODO: make it penal function dependent
        # temporary standin, only checked for Poisson and GLM,
        # and is computationally inefficient
        drop_index = np.nonzero(np.abs(res.params) < trim)[0]
        keep_index = np.nonzero(np.abs(res.params) > trim)[0]
        if drop_index.any():
            # TODO: do we need to add results attributes?
            res_aux = self._fit_zeros(keep_index, **kwds)
            return res_aux
        else:
            return res