{"action":"created","issue":{"url":"https://api.github.com/repos/UDST/urbansim/issues/211","repository_url":"https://api.github.com/repos/UDST/urbansim","labels_url":"https://api.github.com/repos/UDST/urbansim/issues/211/labels{/name}","comments_url":"https://api.github.com/repos/UDST/urbansim/issues/211/comments","events_url":"https://api.github.com/repos/UDST/urbansim/issues/211/events","html_url":"https://github.com/UDST/urbansim/pull/211","id":320370776,"number":211,"title":"worn in the case of non-convergence","user":{"login":"Eh2406","id":3709504,"avatar_url":"https://avatars3.githubusercontent.com/u/3709504?v=4","gravatar_id":"","url":"https://api.github.com/users/Eh2406","html_url":"https://github.com/Eh2406","followers_url":"https://api.github.com/users/Eh2406/followers","following_url":"https://api.github.com/users/Eh2406/following{/other_user}","gists_url":"https://api.github.com/users/Eh2406/gists{/gist_id}","starred_url":"https://api.github.com/users/Eh2406/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eh2406/subscriptions","organizations_url":"https://api.github.com/users/Eh2406/orgs","repos_url":"https://api.github.com/users/Eh2406/repos","events_url":"https://api.github.com/users/Eh2406/events{/privacy}","received_events_url":"https://api.github.com/users/Eh2406/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-04T17:52:06Z","updated_at":"2018-05-18T17:26:30Z","closed_at":"2018-05-18T00:46:44Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/UDST/urbansim/pulls/211","html_url":"https://github.com/UDST/urbansim/pull/211","diff_url":"https://github.com/UDST/urbansim/pull/211.diff","patch_url":"https://github.com/UDST/urbansim/pull/211.patch"},"body":"At yesterday's meeting with @semcogli and @janowicz discuss how deeply **odd** our fitted mnl models wore. Specifically, we have variables that have to be positive that are being fit as negative. In the meeting we considered the possibility of collinearity, or spurious correlations, or bad sampling processes, or other complex possibilities. After the meating I thought that the simplest explanation would be if the optimization algorithm had not successfully `fitted` the models in the first place. \r\n\r\nLooking at the code I see that we did not check it `optimize.fmin_l_bfgs_b` had succeeded. So I added a warning that reports some diagnostic information in case of non-convergence. \r\n\r\nWhen I ran the tests I noted that `test_alternative_specific_coeffs` reliably thru a non-convergence warning `'ABNORMAL_TERMINATION_IN_LNSRCH'`. According to the internet, that diagnostic code is usually caused by programer error. I also noted the `RuntimeWarning: overflow encountered in exp`. After some research I found a standard technique for avoiding overflow in softmax calculations, applying it solved both warnings. The resulting output did not otherwise change.\r\n\r\nTLDR:\r\n\r\n- Warn if we may be returning incorrect output.\r\n- Fix a numerical instability / Overflow.\r\n- No evidence that it solves any of the bigger problems."},"comment":{"url":"https://api.github.com/repos/UDST/urbansim/issues/comments/390276510","html_url":"https://github.com/UDST/urbansim/pull/211#issuecomment-390276510","issue_url":"https://api.github.com/repos/UDST/urbansim/issues/211","id":390276510,"user":{"login":"Eh2406","id":3709504,"avatar_url":"https://avatars3.githubusercontent.com/u/3709504?v=4","gravatar_id":"","url":"https://api.github.com/users/Eh2406","html_url":"https://github.com/Eh2406","followers_url":"https://api.github.com/users/Eh2406/followers","following_url":"https://api.github.com/users/Eh2406/following{/other_user}","gists_url":"https://api.github.com/users/Eh2406/gists{/gist_id}","starred_url":"https://api.github.com/users/Eh2406/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eh2406/subscriptions","organizations_url":"https://api.github.com/users/Eh2406/orgs","repos_url":"https://api.github.com/users/Eh2406/repos","events_url":"https://api.github.com/users/Eh2406/events{/privacy}","received_events_url":"https://api.github.com/users/Eh2406/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T17:26:30Z","updated_at":"2018-05-18T17:26:30Z","author_association":"CONTRIBUTOR","body":"I was just ready to make a pr from: https://github.com/SEMCOG/choicemodels/commit/7d7022fd20d1816eeb47bc2ac011a4fc86db0d42\r\n\r\nBut looks like you did better testing in: https://github.com/UDST/choicemodels/tree/fix-runtime-overflow\r\n\r\nSo I will let you do it!"}}
{"actor":{"display_login":"Eh2406"}}