Daniel306/stat440 — pull request #14 by kousu (2014-11-25 05:39:02+00:00)
Title: "Multigibbs"

So, we've both been suuuuper procrastinating on this. That is okay, especially since you have your coursework to worry about. I finally put my free time to figuring out what ze prof wanted when he kept saying "gibbs sampler". It's taken me a week, but I've finally gotten a start.

`hierarchical_normal/multigibbs.py` has a prototype--currently called `gibbs_hierarchical_normal_wrong()` for reasons explained in the code--of a sampler for the joint dist (U, Y) such that U ~ N(Mu, A) and Y | U ~ N(U, V).
`hierarchical_normal/Derivation.md` has a very roughly sketched derivation of the formulas needed for the conditional distributions U | Y and Y | U. The formulas worked out there seem to match up with `docs/Assignment.pdf`, especially that difficult U | Y formula--once you correct the typos ze prof left us--so that makes me think I did the right thing. On the other hand, I can't figure out why you would

Ultimately, I am left with less questions than I started out with, but still more questions than answers. I've written the most confusing ones in `hierarchical_normal/Questions.md`.

The prototype is in python. You need at least the core [scipy stack](http://www.scipy.org/install.html) installed to try it out, but hopefully the subroutine I've mentioned is pretty straightforward. A TODO, while I remember it: speed test this first python prototype against the future Rcpp version; I think they should be close.

As soon as you have a break in your assignments that you can devote to this, I would really appreciate a second pair of eyes. Start with `Questions.md` and see if you can solve any of them. The algebra was hard, but the algorithm seems too easy, now, so I feel like I must be missing something. Thanks!