Skip to content

BUG: MixedLM.fit blocks optimizer keywords #3605

Closed

Description

@josef-pkt

I wanted to try the new minimize optimization with dogleg, but MixedLM uses a whitelist for kwargs.

using example from #3604

>>> mdf = md.fit(method='minimize', min_method = 'dogleg')
  File "...\statsmodels\regression\mixed_linear_model.py", line 1936, in fit
    raise ValueError("Argument %s not allowed for MixedLM.fit" % x)
ValueError: Argument min_method not allowed for MixedLM.fit
>>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>

Activity

  1. kshedden commented on Apr 11, 2017

    @kshedden
    Contributor
  2. bashtage commented on Jul 30, 2026

    @bashtage
    Member

    Fixed by commit e6f2f84: the hard ValueError was replaced with a RuntimeWarning for disallowed optimizer kwargs, exactly as suggested in this thread. Note: min_method still is not in the allowed-kwargs list, so it is silently stripped (with a warning) rather than passed through - happy to file that as a narrow follow-up enhancement if you want method=minimize sub-methods to actually take effect. Closing as fixed for the reported crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions