{"action":"created","issue":{"url":"https://api.github.com/repos/markovmodel/msmtools/issues/74","repository_url":"https://api.github.com/repos/markovmodel/msmtools","labels_url":"https://api.github.com/repos/markovmodel/msmtools/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/markovmodel/msmtools/issues/74/comments","events_url":"https://api.github.com/repos/markovmodel/msmtools/issues/74/events","html_url":"https://github.com/markovmodel/msmtools/pull/74","id":122932420,"number":74,"title":"Fix nonconverged transition matrix","user":{"login":"fabian-paul","id":8878525,"avatar_url":"https://avatars.githubusercontent.com/u/8878525?v=3","gravatar_id":"","url":"https://api.github.com/users/fabian-paul","html_url":"https://github.com/fabian-paul","followers_url":"https://api.github.com/users/fabian-paul/followers","following_url":"https://api.github.com/users/fabian-paul/following{/other_user}","gists_url":"https://api.github.com/users/fabian-paul/gists{/gist_id}","starred_url":"https://api.github.com/users/fabian-paul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabian-paul/subscriptions","organizations_url":"https://api.github.com/users/fabian-paul/orgs","repos_url":"https://api.github.com/users/fabian-paul/repos","events_url":"https://api.github.com/users/fabian-paul/events{/privacy}","received_events_url":"https://api.github.com/users/fabian-paul/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-18T11:34:08Z","updated_at":"2016-04-04T19:39:35Z","closed_at":"2016-03-30T12:36:32Z","pull_request":{"url":"https://api.github.com/repos/markovmodel/msmtools/pulls/74","html_url":"https://github.com/markovmodel/msmtools/pull/74","diff_url":"https://github.com/markovmodel/msmtools/pull/74.diff","patch_url":"https://github.com/markovmodel/msmtools/pull/74.patch"},"body":"This is a sequel to PR #73. This adds a function (due to Hao) that \"fixes\" almost converged transition matrices. Detailed balance with respect to the old stationary distribution of the matrix is conserved.\r\nPlease tell me what you think."},"comment":{"url":"https://api.github.com/repos/markovmodel/msmtools/issues/comments/205462526","html_url":"https://github.com/markovmodel/msmtools/pull/74#issuecomment-205462526","issue_url":"https://api.github.com/repos/markovmodel/msmtools/issues/74","id":205462526,"user":{"login":"franknoe","id":6495810,"avatar_url":"https://avatars.githubusercontent.com/u/6495810?v=3","gravatar_id":"","url":"https://api.github.com/users/franknoe","html_url":"https://github.com/franknoe","followers_url":"https://api.github.com/users/franknoe/followers","following_url":"https://api.github.com/users/franknoe/following{/other_user}","gists_url":"https://api.github.com/users/franknoe/gists{/gist_id}","starred_url":"https://api.github.com/users/franknoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franknoe/subscriptions","organizations_url":"https://api.github.com/users/franknoe/orgs","repos_url":"https://api.github.com/users/franknoe/repos","events_url":"https://api.github.com/users/franknoe/events{/privacy}","received_events_url":"https://api.github.com/users/franknoe/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T19:39:35Z","updated_at":"2016-04-04T19:39:35Z","body":"1) I don't understand how it could be non-row stochastic as a result of the number of iterations. There are two options - In the dense estimator you iterate X and then get T by direct row-normalization:\r\n```python\r\nxsumnew = np.sum(X, axis=1)\r\n...\r\nxsum = xsumnew\r\n...\r\nT = correct_transition_matrix(X / xsum[:, np.newaxis])\r\n```\r\nwhich is equivalent to\r\n```python\r\nT = correct_transition_matrix(X / X.sum(axis=1)[:, None])\r\n```\r\nSo how could that be further corrected, unless in pathogological cases where ```X.sum(axis=1)``` is zero?  \r\nThe second option is to iterate ```pi``` and then insert into the MLE equation for P given pi. At this point one could get a matrix that is distinctly non-row-stochastic due to numerical errors, but this would be independent of the number of iterations used to obtain the estimate for ```pi```\r\n2) OK, understood.\r\n3) I guess this is related to 1. If you work with X and not with pi, isn't just row-normalization the same as \"fixing\"?"}}