gpytorch
gpytorch copied to clipboard
Calculating probability of draw from posterior distribution
I'm fitting a GP to some data y1, and want to calculate the probability of some different data, y2, under that GP model.
So p( y2 | GP(y1) )
Is that possible?
Cheers
Yeah you can compute the posterior prediction under your input x2
if associated with a pair (x2, y2)
- for an exact GP this will give you a MVN, and you can then just compute the log prob of the data y2
under that.
Thanks! If I'm not doing an exact GP, how do I calculate the log prob of data y2
?
It should be the same for a variational model. Train the variational model on x1, y1, and then make a prediction on x2. This should also output an MVN, and so you could then compute the logprob of y1.
Of course, everything is approximate in this case.