{"action":"created","issue":{"url":"https://api.github.com/repos/jlaake/marked/issues/4","labels_url":"https://api.github.com/repos/jlaake/marked/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/jlaake/marked/issues/4/comments","events_url":"https://api.github.com/repos/jlaake/marked/issues/4/events","html_url":"https://github.com/jlaake/marked/pull/4","id":68805598,"number":4,"title":"fix bug in Gibbs sampler for betas","user":{"login":"bmcclintock","id":11667599,"avatar_url":"https://avatars.githubusercontent.com/u/11667599?v=3","gravatar_id":"","url":"https://api.github.com/users/bmcclintock","html_url":"https://github.com/bmcclintock","followers_url":"https://api.github.com/users/bmcclintock/followers","following_url":"https://api.github.com/users/bmcclintock/following{/other_user}","gists_url":"https://api.github.com/users/bmcclintock/gists{/gist_id}","starred_url":"https://api.github.com/users/bmcclintock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmcclintock/subscriptions","organizations_url":"https://api.github.com/users/bmcclintock/orgs","repos_url":"https://api.github.com/users/bmcclintock/repos","events_url":"https://api.github.com/users/bmcclintock/events{/privacy}","received_events_url":"https://api.github.com/users/bmcclintock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-15T23:02:45Z","updated_at":"2015-04-16T15:19:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jlaake/marked/pulls/4","html_url":"https://github.com/jlaake/marked/pull/4","diff_url":"https://github.com/jlaake/marked/pull/4.diff","patch_url":"https://github.com/jlaake/marked/pull/4.patch"},"body":"I noticed this after playing around with the beta prior distributions and finding extreme prior sensitivity (the bug is barely discernible using the default priors). I think the Gibbs updates are now correct, but Devin should probably take a look and confirm."},"comment":{"url":"https://api.github.com/repos/jlaake/marked/issues/comments/93761389","html_url":"https://github.com/jlaake/marked/pull/4#issuecomment-93761389","issue_url":"https://api.github.com/repos/jlaake/marked/issues/4","id":93761389,"user":{"login":"pconn","id":910739,"avatar_url":"https://avatars.githubusercontent.com/u/910739?v=3","gravatar_id":"","url":"https://api.github.com/users/pconn","html_url":"https://github.com/pconn","followers_url":"https://api.github.com/users/pconn/followers","following_url":"https://api.github.com/users/pconn/following{/other_user}","gists_url":"https://api.github.com/users/pconn/gists{/gist_id}","starred_url":"https://api.github.com/users/pconn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pconn/subscriptions","organizations_url":"https://api.github.com/users/pconn/orgs","repos_url":"https://api.github.com/users/pconn/repos","events_url":"https://api.github.com/users/pconn/events{/privacy}","received_events_url":"https://api.github.com/users/pconn/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T15:19:18Z","updated_at":"2015-04-16T15:19:18Z","body":"Yeah, not sure doing the scaling makes as much sense in latent variable\napplications when the design matrix potentially changes each iteration.  I\nhaven't looked at the code, but this means that updates for latent\nvariables would also require evaluating the prior distribution for Beta in\nthe full conditional...\n\nMaybe in this case it does make the most sense to put in a constant \\tau\n(or, maybe have ability to enter it in as a vector if there's multiple\nregression parameters).\n\nOn Wed, Apr 15, 2015 at 6:56 PM, bmcclintock <notifications@github.com>\nwrote:\n\n> I see that \\tau=1 makes for a very informative prior using the \\tau\n> (X'X)^{-1} approach, but because X'X for this model depends on the\n> latent variables (z) at each iteration, it seems it will be pretty tough\n> for folks to specify priors for Beta.\n>\n> Brett\n>\n> On 4/15/2015 5:49 PM, Brett McClintock - NOAA Federal wrote:\n> > Have you tried this approach with \\tau > 0.01? I've been running\n> > probitCJS() with \\tau = 1 (or 0.1), which seem like perfectly\n> > reasonable ''barely-informative'' priors for the probit link. With\n> > simulated data (\\phi ~ 0.95, p ~ 0.4), I get horrifically lousy\n> > estimates.\n> >\n> > Here it is for the good 'ol dipper data:\n> >\n> > data(dipper)\n> > # Default prior distributions \\tau=0.01:\n> > fit1 =\n> >\n> crm(dipper,model=\"probitCJS\",model.parameters=list(Phi=list(formula=~time),p=list(formula=~time)),\n>\n> > burnin=5000, iter=50000)\n> > # Real parameter summary\n> > fit1$results$reals\n> > $Phi\n> > time occ mode mean sd CI.lower CI.upper\n> > 1 6 6 0.5802428 0.6157544 0.1067098 0.4318847 0.8961070\n> > 2 5 5 0.5983627 0.6113757 0.1072963 0.4048039 0.9193108\n> > 3 4 4 0.6105205 0.6246322 0.1225496 0.4251695 0.9575122\n> > 4 3 3 0.4691240 0.5610643 0.1787757 0.3553289 0.9784923\n> > 5 2 2 0.4740408 0.6467389 0.2031592 0.3841401 0.9999156\n> > 6 1 1 0.9954080 0.8256072 0.1657278 0.5282918 1.0000000\n> >\n> > $p\n> > time occ mode mean sd CI.lower CI.upper\n> > 1 7 7 0.9830198 0.8259658 0.1661635 0.3839609 0.9999998\n> > 2 6 6 0.9378322 0.8527325 0.1708688 0.3561641 0.9971572\n> > 3 5 5 0.9214020 0.8026059 0.1934767 0.3238298 0.9821723\n> > 4 4 4 0.9126367 0.7238430 0.2315205 0.2885504 0.9832404\n> > 5 3 3 0.8958076 0.6543822 0.2132083 0.3325620 0.9910540\n> > 6 2 2 0.5698856 0.6154969 0.1569900 0.3370045 0.9175915\n> >\n> > # Changing prior distributions to \\tau=1:\n> > fit2 =\n> >\n> crm(dipper,model=\"probitCJS\",model.parameters=list(Phi=list(formula=~time,\n> > prior=list(mu=rep(0,6), tau=1)),p=list(formula=~time,\n> > prior=list(mu=rep(0,6), tau=1))), burnin=5000, iter=50000)\n> > # Real parameter summary\n> > fit2$results$reals\n> > $Phi\n> > time occ mode mean sd CI.lower CI.upper\n> > 1 6 6 0.5653200 0.5638793 0.03237527 0.5006367 0.6271644\n> > 2 5 5 0.5581776 0.5599721 0.03350454 0.4946596 0.6258098\n> > 3 4 4 0.5543651 0.5534975 0.03469824 0.4839541 0.6193838\n> > 4 3 3 0.5129871 0.5143534 0.03648440 0.4418147 0.5840749\n> > 5 2 2 0.5135764 0.5177559 0.04252288 0.4340589 0.5998533\n> > 6 1 1 0.5762414 0.5766708 0.06972554 0.4398088 0.7116584\n> >\n> > $p\n> > time occ mode mean sd CI.lower CI.upper\n> > 1 7 7 0.5869295 0.5912162 0.03911119 0.5135447 0.6670067\n> > 2 6 6 0.6131401 0.6162346 0.04041677 0.5362677 0.6940604\n> > 3 5 5 0.6119031 0.6182684 0.04223474 0.5341609 0.6992560\n> > 4 4 4 0.5974503 0.5972898 0.04822438 0.5052169 0.6946310\n> > 5 3 3 0.5960049 0.5939367 0.05625055 0.4836240 0.7040048\n> > 6 2 2 0.5867878 0.5843892 0.08063812 0.4282024 0.7412024\n> >\n> >\n> > p is supposed to be around 0.9 for these data. Scary! Or maybe I'm\n> > missing something here?\n> >\n> > Brett\n> >\n> >\n> > On 4/15/2015 4:16 PM, Paul Conn wrote:\n> >> I think this might have to do with a common choice Devin makes for the\n> >> priors on Beta - namely he sets them to\n> >>\n> >> Beta ~ MVN(0,\\tau (X'X)^{-1})\n> >>\n> >> to scale them to the priors relative magnitude of the design matrix and\n> >> improve mixing. I think this is something Jennifer Hoeting has\n> advocated,\n> >> if I remember Devin's explanation correctly. It's also a strategy I've\n> >> adopted, so would be interested to hear what issues you've had with it!\n> >>\n> >> -P\n> >>\n> >> On Wed, Apr 15, 2015 at 4:02 PM, bmcclintock <notifications@github.com>\n> >> wrote:\n> >>\n> >> > I noticed this after playing around with the beta prior\n> >> distributions and\n> >> > finding extreme prior sensitivity (the bug is barely discernible\n> >> using the\n> >> > default priors). I think the Gibbs updates are now correct, but Devin\n> >> > should probably take a look and confirm.\n> >> > ------------------------------\n> >> > You can view, comment on, or merge this pull request online at:\n> >> >\n> >> > https://github.com/jlaake/marked/pull/4\n> >> > Commit Summary\n> >> >\n> >> > - fix bug in Gibbs sampler for betas\n> >> >\n> >> > File Changes\n> >> >\n> >> > - *M* marked/R/probitCJS.R\n> >> > <https://github.com/jlaake/marked/pull/4/files#diff-0> (10)\n> >> >\n> >> > Patch Links:\n> >> >\n> >> > - https://github.com/jlaake/marked/pull/4.patch\n> >> > - https://github.com/jlaake/marked/pull/4.diff\n> >> >\n> >> > —\n> >> > Reply to this email directly or view it on GitHub\n> >> > <https://github.com/jlaake/marked/pull/4>.\n> >> >\n> >>\n> >>\n> >>\n> >> --\n> >> Paul Conn\n> >> Research Statistician\n> >> Polar Ecosystems Program\n> >> National Marine Mammal Lab\n> >> NOAA Alaska Fisheries Science Center\n> >> 7600 Sand Point Way, Building 4\n> >> Seattle, WA 98115\n> >>\n> >> tel 206.526.4235\n> >>\n> >> —\n> >> Reply to this email directly or view it on GitHub\n> >> <https://github.com/jlaake/marked/pull/4#issuecomment-93594868>.\n> >>\n> >\n> > --\n> > ***************************************************************\n> > Brett T. McClintock, Ph.D.\n> > NOAA National Marine Mammal Laboratory\n> > 7600 Sand Point Way NE\n> > Seattle, WA 98115 USA\n> >\n> > PHONE: +1 206 526 4152\n> > FAX: +1 206 526 6615\n> > ***************************************************************\n>\n> --\n> ***************************************************************\n> Brett T. McClintock, Ph.D.\n> NOAA National Marine Mammal Laboratory\n> 7600 Sand Point Way NE\n> Seattle, WA 98115 USA\n>\n> PHONE: +1 206 526 4152\n> FAX: +1 206 526 6615\n> ***************************************************************\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/jlaake/marked/pull/4#issuecomment-93616175>.\n>\n\n\n\n-- \nPaul Conn\nResearch Statistician\nPolar Ecosystems Program\nNational Marine Mammal Lab\nNOAA Alaska Fisheries Science Center\n7600 Sand Point Way, Building 4\nSeattle, WA 98115\n\ntel 206.526.4235\n"}}