Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: full_output in optimizers Likelihood model #450

Closed
josef-pkt opened this issue Sep 2, 2012 · 4 comments · Fixed by #730
Closed

BUG: full_output in optimizers Likelihood model #450

josef-pkt opened this issue Sep 2, 2012 · 4 comments · Fixed by #730

Comments

@josef-pkt
Copy link
Member

full_output=False

In this case, the default fit function (newton) returns one array (newparams). However, LikelihoodModel.fit() expects 2. fit() then tries to unpack newparams into two variables, and thus gives the ValueError "too many values to unpack" (unless for some reason newparams is of length 2). (Ian Langmore on mailinglist)

if params is of length 2, using newton silently cuts off one parameter.

looking at the code, I also found that xopt is not defined in any of the full_output=False cases:

    return xopt, retvals
UnboundLocalError: local variable 'xopt' referenced before assignment
@josef-pkt
Copy link
Member Author

needs regression tests to avoid refactoring bugs.

@jseabold
Copy link
Member

Is there a small example that demonstrates this that can be used for testing?

@jseabold
Copy link
Member

It looks to me like a lot of these are going to be broken if full_output = False. I wonder if it's a refactoring victim or if it ever worked... Need to think a bit about what we want and look at the new optimize interface in scipy for guidance.

@jseabold
Copy link
Member

I started a branch to fix this here https://github.com/jseabold/statsmodels/tree/fix-opt-fulloutput

I think it's okay now but needs some tests. Might just be able to steal some from scipy.optimize and just have some smoke tests.

PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants