{"action":"created","issue":{"url":"https://api.github.com/repos/pymc-devs/pymc3/issues/1031","repository_url":"https://api.github.com/repos/pymc-devs/pymc3","labels_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/1031/labels{/name}","comments_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/1031/comments","events_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/1031/events","html_url":"https://github.com/pymc-devs/pymc3/pull/1031","id":142196172,"number":1031,"title":"Adaptive Transitional Markov Chain Monte Carlo","user":{"login":"eigenblutwurst","id":11273616,"avatar_url":"https://avatars.githubusercontent.com/u/11273616?v=3","gravatar_id":"","url":"https://api.github.com/users/eigenblutwurst","html_url":"https://github.com/eigenblutwurst","followers_url":"https://api.github.com/users/eigenblutwurst/followers","following_url":"https://api.github.com/users/eigenblutwurst/following{/other_user}","gists_url":"https://api.github.com/users/eigenblutwurst/gists{/gist_id}","starred_url":"https://api.github.com/users/eigenblutwurst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eigenblutwurst/subscriptions","organizations_url":"https://api.github.com/users/eigenblutwurst/orgs","repos_url":"https://api.github.com/users/eigenblutwurst/repos","events_url":"https://api.github.com/users/eigenblutwurst/events{/privacy}","received_events_url":"https://api.github.com/users/eigenblutwurst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-03-20T19:36:25Z","updated_at":"2016-03-21T12:42:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/1031","html_url":"https://github.com/pymc-devs/pymc3/pull/1031","diff_url":"https://github.com/pymc-devs/pymc3/pull/1031.diff","patch_url":"https://github.com/pymc-devs/pymc3/pull/1031.patch"},"body":"Renamed the branch to ATMCMC because of @twiecki 's confusion - so therefore this:\r\nhttps://github.com/pymc-devs/pymc3/pull/1025\r\nis deprecated.\r\nNow it definitely works on real data and this synthetic test.\r\nThe parallel implementation does work for simple models. But I get segmentation faults for my complex model for njobs > 1 as mentioned here https://github.com/pymc-devs/pymc3/issues/879. But this also happens for the other standard algorithms implemented in pymc3.\r\nHere again the test script:\r\n\r\n```javascript\r\nimport pymc3 as pm\r\nimport numpy as num\r\nfrom pymc3.step_methods import ATMCMC as atmcmc\r\nimport theano.tensor as tt\r\nfrom matplotlib import pylab as pl\r\n\r\ntest_folder = ('/data/SAR_data/Aqaba1995/subsampled/model_result_InSAR_Seis/'\r\n               'ATMIP_TEST')\r\n\r\nN_chains = 1000\r\nN_steps = 100\r\ntune_interval = 25\r\nnjobs = 1\r\n\r\nn = 10\r\n\r\nmu1 = num.ones(n) * (1. / 2)\r\nmu2 = -mu1\r\n\r\nstdev = 0.1\r\nsigma = num.power(stdev, 2) * num.eye(n)\r\nisigma = num.linalg.inv(sigma)\r\ndsigma = num.linalg.det(sigma)\r\n\r\nw1 = stdev\r\nw2 = (1 - stdev)\r\n\r\n\r\ndef two_gaussians(x):\r\n    log_like1 = - 0.5 * n * tt.log(2 * num.pi) \\\r\n                - 0.5 * tt.log(dsigma) \\\r\n                - 0.5 * (x - mu1).T.dot(isigma).dot(x - mu1)\r\n    log_like2 = - 0.5 * n * tt.log(2 * num.pi) \\\r\n                - 0.5 * tt.log(dsigma) \\\r\n                - 0.5 * (x - mu2).T.dot(isigma).dot(x - mu2)\r\n    return tt.log(w1 * tt.exp(log_like1) + w2 * tt.exp(log_like2))\r\n\r\nwith pm.Model() as ATMIP_test:\r\n    X = pm.Uniform('X',\r\n                   shape=n,\r\n                   lower=-2. * num.ones_like(mu1),\r\n                   upper=2. * num.ones_like(mu1),\r\n                   testval=-1. * num.ones_like(mu1),\r\n                   transform=None)\r\n    like = pm.Deterministic('like', two_gaussians(X))\r\n    llk = pm.Potential('like', like)\r\n\r\nwith ATMIP_test:\r\n    step = atmcmc.ATMCMC(N_chains=N_chains, tune_interval=tune_interval,\r\n                         likelihood_name=ATMIP_test.deterministics[0].name)\r\n\r\ntrcs = atmcmc.ATMIP_sample(\r\n                        N_steps=N_steps,\r\n                        step=step,\r\n                        njobs=njobs,\r\n                        progressbar=True,\r\n                        trace=test_folder,\r\n                        model=ATMIP_test)\r\n\r\npm.summary(trcs)\r\nPltr = pm.traceplot(trcs, combined=True)\r\npl.show(Pltr[0][0])\r\n```\r\nRun with the parameters from script above.\r\n![atmip_2gaussians_10d](https://cloud.githubusercontent.com/assets/11273616/13906622/224f6304-eeec-11e5-8155-1e4ad1658d64.png)\r\n\r\nChain result: It even gets the relative weight correctly. With longer chains it would be even better.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pymc-devs/pymc3/issues/comments/199256042","html_url":"https://github.com/pymc-devs/pymc3/pull/1031#issuecomment-199256042","issue_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/1031","id":199256042,"user":{"login":"springcoil","id":983944,"avatar_url":"https://avatars.githubusercontent.com/u/983944?v=3","gravatar_id":"","url":"https://api.github.com/users/springcoil","html_url":"https://github.com/springcoil","followers_url":"https://api.github.com/users/springcoil/followers","following_url":"https://api.github.com/users/springcoil/following{/other_user}","gists_url":"https://api.github.com/users/springcoil/gists{/gist_id}","starred_url":"https://api.github.com/users/springcoil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/springcoil/subscriptions","organizations_url":"https://api.github.com/users/springcoil/orgs","repos_url":"https://api.github.com/users/springcoil/repos","events_url":"https://api.github.com/users/springcoil/events{/privacy}","received_events_url":"https://api.github.com/users/springcoil/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T12:42:57Z","updated_at":"2016-03-21T12:42:57Z","body":"There's no source data at all? \r\nYou can just point to the current folder. \r\n\r\n:+1: for the rest. "}}