-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sampling from Posterior Distribution #21
Comments
Hi Sterling, fitrgp didn't exist when we were writing this code (MATLAB didn't have native GP implementations) so I don't know how it works (and since then we moved to python as a group). But in gpmat the posterior mean and variance are computed through gpPosteriorMeanVar, details here: https://github.com/SheffieldML/GPmat/blob/master/gp/gpPosteriorMeanVar.m |
Hi Neil, that makes sense. I'll be following suit since I just joined a group based mostly in python (these questions are related to my previous research). This seems like a good resource. Since I have the mean values and covariance matrix already from MATLAB's fitrgp(), It seems like gsamp.m from NetLab does what I'm looking for in generating samples of the posterior distribution like in the example given in the README file: |
Yes, I suspect it does, netlab dates back to around 1996 when MATLAB had very poor support for stats and machine learning. I suspect they've covered most of the gaps since then. GPmat was developed from about 2003, and again there were big gaps in MATLAB (or silly toolboxes that required extra licenses). The history also explains why it is written in a particular way ... when I first was implementing it in 2003, the MATLAB object oriented stuff was incredibly slow, so it's all implemented with feval to do late binding of 'methods'. Which can make it quite hard to follow. But the basic structure carries forward to the GPy software, and therefore influences other Python GP packages (like GPflow). |
Thanks for the comments, I think that's great you had an implementation before it became standard. It also seems that doing some things that are standard in GPmat are undocumented functions in fitrgp(), e.g. obtaining the posterior covariance matrix to sample from the posterior, which has made it a bit difficult 😅, and hence exploring other options like GPmat. Again, thank you for the help. |
If I have the mean and covariance functions (via MATLAB's fitrgp() ), how can I sample from the posterior?
The text was updated successfully, but these errors were encountered: