{"action":"created","issue":{"url":"https://api.github.com/repos/pymc-devs/pymc3/issues/2226","repository_url":"https://api.github.com/repos/pymc-devs/pymc3","labels_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/2226/labels{/name}","comments_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/2226/comments","events_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/2226/events","html_url":"https://github.com/pymc-devs/pymc3/issues/2226","id":231753064,"number":2226,"title":"Using random variables as `observed`","user":{"login":"aplavin","id":687995,"avatar_url":"https://avatars1.githubusercontent.com/u/687995?v=3","gravatar_id":"","url":"https://api.github.com/users/aplavin","html_url":"https://github.com/aplavin","followers_url":"https://api.github.com/users/aplavin/followers","following_url":"https://api.github.com/users/aplavin/following{/other_user}","gists_url":"https://api.github.com/users/aplavin/gists{/gist_id}","starred_url":"https://api.github.com/users/aplavin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aplavin/subscriptions","organizations_url":"https://api.github.com/users/aplavin/orgs","repos_url":"https://api.github.com/users/aplavin/repos","events_url":"https://api.github.com/users/aplavin/events{/privacy}","received_events_url":"https://api.github.com/users/aplavin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-26T23:06:30Z","updated_at":"2017-05-27T00:08:28Z","closed_at":"2017-05-27T00:08:28Z","body":"I'm trying to build a regression model, which takes into account errors both in x and y measurements. There is a solution [here](https://stackoverflow.com/a/39685419/693369):\r\n```\r\nwith pm.Model() as model:\r\n    intercept = pm.Normal('intercept', 0, sd=20)\r\n    gradient = pm.Normal('gradient', 0, sd=20)\r\n    epsilon = pm.HalfCauchy('epsilon', 5)\r\n    obs_x = pm.Normal('obs_x', mu=x, sd=x_err, shape=len(x))\r\n    obs_y = pm.Normal('obs_y', mu=y, sd=y_err, shape=len(y))\r\n    likelihood = pm.Normal('y', mu=intercept + gradient * obs_x,\r\n                    sd=epsilon, observed=obs_y)\r\n```\r\n\r\nBut as I understand, using `obs_y` as `observed` is not supported anymore and gives corresponding error. While it probably makes sense, I can't get around how to rewrite this model in another way? Is something like this correct?\r\n```\r\nwith pm.Model() as model:\r\n    intercept = pm.Normal('intercept', 0, sd=20)\r\n    gradient = pm.Normal('gradient', 0, sd=20)\r\n    epsilon = pm.HalfCauchy('epsilon', 5)\r\n    obs_x = pm.Normal('obs_x', mu=x, sd=x_err, shape=len(x))\r\n    obs_y = pm.Normal('obs_y', mu=intercept + gradient * obs_x, sd=epsilon)\r\n    likelihood = pm.Normal('y', mu=obs_y,\r\n                    sd=y_err, observed=y)\r\n```"},"comment":{"url":"https://api.github.com/repos/pymc-devs/pymc3/issues/comments/304412006","html_url":"https://github.com/pymc-devs/pymc3/issues/2226#issuecomment-304412006","issue_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/2226","id":304412006,"user":{"login":"fonnesbeck","id":81476,"avatar_url":"https://avatars0.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":"2017-05-27T00:08:28Z","updated_at":"2017-05-27T00:08:28Z","body":"Going to close this because it is not an issue but feel free to continue the conversation. "}}
{"actor":{"display_login":"fonnesbeck"}}