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: MNLogit loglikeobs, jac #418

Closed
josef-pkt opened this issue Aug 5, 2012 · 2 comments
Closed

BUG: MNLogit loglikeobs, jac #418

josef-pkt opened this issue Aug 5, 2012 · 2 comments

Comments

@josef-pkt
Copy link
Member

in loglike, d and logprob, are 2d. I think to get loglikeobs we should add over axis=1

return (d * logprob).sum(1)  

I guess jac has a similar mistake.

The test uses sum() and so doesn't realize that loglikeobs has the wrong shape.

@josef-pkt
Copy link
Member Author

I thought I fixed this but cannot find where (or if) right now.

@josef-pkt
Copy link
Member Author

I don't find a bugfix, but this looks all correct

was added in
7302d53 #147

>>> np.max(np.abs(mlogit_res.model.jac(mlogit_res.params).sum(0) - mlogit_res.model.score(mlogit_res.params)))
1.0844797282416607e-13

>>> np.max(np.abs(mlogit_res.model.loglikeobs(mlogit_res.params).sum() - mlogit_res.model.loglike(mlogit_res.params)))
0.0

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

No branches or pull requests

1 participant