{"action":"created","issue":{"url":"https://api.github.com/repos/dfm/emcee/issues/279","repository_url":"https://api.github.com/repos/dfm/emcee","labels_url":"https://api.github.com/repos/dfm/emcee/issues/279/labels{/name}","comments_url":"https://api.github.com/repos/dfm/emcee/issues/279/comments","events_url":"https://api.github.com/repos/dfm/emcee/issues/279/events","html_url":"https://github.com/dfm/emcee/issues/279","id":365156773,"node_id":"MDU6SXNzdWUzNjUxNTY3NzM=","number":279,"title":"Added support for emcee in arviz","user":{"login":"ColCarroll","id":2295568,"node_id":"MDQ6VXNlcjIyOTU1Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/2295568?v=4","gravatar_id":"","url":"https://api.github.com/users/ColCarroll","html_url":"https://github.com/ColCarroll","followers_url":"https://api.github.com/users/ColCarroll/followers","following_url":"https://api.github.com/users/ColCarroll/following{/other_user}","gists_url":"https://api.github.com/users/ColCarroll/gists{/gist_id}","starred_url":"https://api.github.com/users/ColCarroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColCarroll/subscriptions","organizations_url":"https://api.github.com/users/ColCarroll/orgs","repos_url":"https://api.github.com/users/ColCarroll/repos","events_url":"https://api.github.com/users/ColCarroll/events{/privacy}","received_events_url":"https://api.github.com/users/ColCarroll/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-29T18:42:35Z","updated_at":"2018-10-01T16:15:55Z","closed_at":null,"author_association":"NONE","body":"Wanted to let you know we have added support for emcee to the arviz library - see https://github.com/arviz-devs/arviz/pull/302 for a description of the change. \r\n\r\nRoughly, the plan is for arviz to replace plotting and diagnostics for pymc3 (so we do not have to rewrite it for pymc4), by converting data to a common data format (netCDF/xarray datasets), and then implementing all the plots and diagnostics on that object. emcee is the third library to have support (pymc3 and pystan), after hearing so many astronomers saying nice things about it at a conference.\r\n\r\nIn addition to the plots you can see in the pull request above, you can also calculate things like the effective sample size and the gelman rubin statistic. The `summary` function below shows a number of these.\r\n\r\nSome questions I had -\r\n-  we store `sample_stats` from pystan and pymc3. Is there a way to access whether a sample was accepted at a per-draw basis in `emcee`? \r\n- Are there particular diagnostics or plots you would like to see?\r\n\r\n```python\r\nimport arviz as az\r\nfrom arviz.tests import helpers\r\n\r\nsampler = helpers.emcee_linear_model(None, 500, 10)  # this is the sampler from http://dfm.io/emcee/current/user/line/\r\n\r\n# This converter turns the data into a netCDF object that can be serialized and shared\r\ndata = az.from_emcee(sampler, var_names=['ln(f)', 'b', 'm'])\r\n\r\n# all arviz functions should work with this object\r\naz.summary(data).to_dataframe()\r\n```\r\n\r\n<table border=\"1\" class=\"dataframe\">\r\n  <thead>\r\n    <tr style=\"text-align: right;\">\r\n      <th></th>\r\n      <th>ln(f)</th>\r\n      <th>b</th>\r\n      <th>m</th>\r\n    </tr>\r\n    <tr>\r\n      <th>metric</th>\r\n      <th></th>\r\n      <th></th>\r\n      <th></th>\r\n    </tr>\r\n  </thead>\r\n  <tbody>\r\n    <tr>\r\n      <th>mean</th>\r\n      <td>-0.901523</td>\r\n      <td>4.186736</td>\r\n      <td>-0.493168</td>\r\n    </tr>\r\n    <tr>\r\n      <th>standard deviation</th>\r\n      <td>0.083640</td>\r\n      <td>0.387793</td>\r\n      <td>0.146651</td>\r\n    </tr>\r\n    <tr>\r\n      <th>mc error</th>\r\n      <td>0.002052</td>\r\n      <td>0.008238</td>\r\n      <td>0.003727</td>\r\n    </tr>\r\n    <tr>\r\n      <th>hpd 3.00%</th>\r\n      <td>-1.061138</td>\r\n      <td>3.448212</td>\r\n      <td>-0.759357</td>\r\n    </tr>\r\n    <tr>\r\n      <th>hpd 97.00%</th>\r\n      <td>-0.742526</td>\r\n      <td>4.923531</td>\r\n      <td>-0.201992</td>\r\n    </tr>\r\n    <tr>\r\n      <th>effective samples</th>\r\n      <td>1429.248983</td>\r\n      <td>1408.863122</td>\r\n      <td>1287.373414</td>\r\n    </tr>\r\n    <tr>\r\n      <th>gelman-rubin statistic</th>\r\n      <td>1.030000</td>\r\n      <td>1.030000</td>\r\n      <td>1.040000</td>\r\n    </tr>\r\n  </tbody>\r\n</table>\r\n"},"comment":{"url":"https://api.github.com/repos/dfm/emcee/issues/comments/425968096","html_url":"https://github.com/dfm/emcee/issues/279#issuecomment-425968096","issue_url":"https://api.github.com/repos/dfm/emcee/issues/279","id":425968096,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTk2ODA5Ng==","user":{"login":"Gabriel-p","id":6054951,"node_id":"MDQ6VXNlcjYwNTQ5NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/6054951?v=4","gravatar_id":"","url":"https://api.github.com/users/Gabriel-p","html_url":"https://github.com/Gabriel-p","followers_url":"https://api.github.com/users/Gabriel-p/followers","following_url":"https://api.github.com/users/Gabriel-p/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel-p/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel-p/subscriptions","organizations_url":"https://api.github.com/users/Gabriel-p/orgs","repos_url":"https://api.github.com/users/Gabriel-p/repos","events_url":"https://api.github.com/users/Gabriel-p/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel-p/received_events","type":"User","site_admin":false},"created_at":"2018-10-01T16:15:55Z","updated_at":"2018-10-01T16:15:55Z","author_association":"NONE","body":"Quick question @dfm : I'm currently using PyMC3's [effective_n](https://docs.pymc.io/api/diagnostics.html#pymc3.diagnostics.effective_n) function to estimate the effective sample size for samplers of both `emcee` and [`ptemcee`](https://github.com/willvousden/ptemcee). Is this not allowed? Or is it a reasonable estimate with some caveats?"}}
{"actor":{"display_login":"Gabriel-p"}}