goldingn/BayesComm — pull request #1 by davharris (2013-09-28 21:20:14+00:00)
Title: add a `predict` function

Hey Nick, it was really fantastic meeting you in person last week. My girlfriend was delighted about the jam you brought us.

Anyway, I was playing around with your package, and I noticed you didn't seem to have a `predict` function. Since I might need one for some model comparisons I've been wanting to do, I thought I'd see if I could add it myself.

**I don't know if what I've added is correct**, but I thought it might be a useful starting point for you. If you like the changes I've made, please feel free to pull them in.

The main place where I'm uncertain about correctness is my construction of the covariance matrix and sampling `z` from it. It looks like a lot of what I wrote will be replaceable with something like

```
trunc <- find_trunc(mu, y)
e <- sample_e(e, trunc, iR)
z <- mu + e
```

but I'm not really sure how that aspect of your code works.

Anyway, hope this turns into something useful for you, and thanks again!

Dave