{"action":"created","issue":{"url":"https://api.github.com/repos/pymc-devs/pymc/issues/86","labels_url":"https://api.github.com/repos/pymc-devs/pymc/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/pymc-devs/pymc/issues/86/comments","events_url":"https://api.github.com/repos/pymc-devs/pymc/issues/86/events","html_url":"https://github.com/pymc-devs/pymc/issues/86","id":123033926,"number":86,"title":"ZeroDivisionError: float division by zero in NormalApproximation.py","user":{"login":"bjlkeng","id":8584879,"avatar_url":"https://avatars.githubusercontent.com/u/8584879?v=3","gravatar_id":"","url":"https://api.github.com/users/bjlkeng","html_url":"https://github.com/bjlkeng","followers_url":"https://api.github.com/users/bjlkeng/followers","following_url":"https://api.github.com/users/bjlkeng/following{/other_user}","gists_url":"https://api.github.com/users/bjlkeng/gists{/gist_id}","starred_url":"https://api.github.com/users/bjlkeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjlkeng/subscriptions","organizations_url":"https://api.github.com/users/bjlkeng/orgs","repos_url":"https://api.github.com/users/bjlkeng/repos","events_url":"https://api.github.com/users/bjlkeng/events{/privacy}","received_events_url":"https://api.github.com/users/bjlkeng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-18T22:03:46Z","updated_at":"2015-12-22T15:51:40Z","closed_at":null,"body":"Hi, I was fitting a `Lognormal()` model using `pymc.MAP()` and got this error:\r\n\r\n    File \".../local/lib/python2.7/site-packages/pymc/NormalApproximation.py\", line 371, in fit\r\n    self.AICc = self.AIC + ((2 * self.len * (self.len + 1)) / float(self.data_len - self.len - 1))\r\n    ZeroDivisionError: float division by zero\r\n\r\nSomehow it got a divide by zero but if I comment out the line, my the MAP estimates seem fine.  Should the `AICc` calculation be wrapped in a `try/except` block like the `BIC` calculation?\r\n\r\nI'm using `pymc==2.3.6` and Python 2.7.6 on Ubuntu."},"comment":{"url":"https://api.github.com/repos/pymc-devs/pymc/issues/comments/166653999","html_url":"https://github.com/pymc-devs/pymc/issues/86#issuecomment-166653999","issue_url":"https://api.github.com/repos/pymc-devs/pymc/issues/86","id":166653999,"user":{"login":"fonnesbeck","id":81476,"avatar_url":"https://avatars.githubusercontent.com/u/81476?v=3","gravatar_id":"","url":"https://api.github.com/users/fonnesbeck","html_url":"https://github.com/fonnesbeck","followers_url":"https://api.github.com/users/fonnesbeck/followers","following_url":"https://api.github.com/users/fonnesbeck/following{/other_user}","gists_url":"https://api.github.com/users/fonnesbeck/gists{/gist_id}","starred_url":"https://api.github.com/users/fonnesbeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fonnesbeck/subscriptions","organizations_url":"https://api.github.com/users/fonnesbeck/orgs","repos_url":"https://api.github.com/users/fonnesbeck/repos","events_url":"https://api.github.com/users/fonnesbeck/events{/privacy}","received_events_url":"https://api.github.com/users/fonnesbeck/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T15:51:40Z","updated_at":"2015-12-22T15:51:40Z","body":"I did go ahead and improve exception handling for AIC/BIC in #89, so give that a try, but you should be passing all of the PyMC variables to the model. I recommend either passing `locals()` to `MCMC`, or wrapping your model definition in a function that returns `locals()`."}}