cornellius-gp / gpytorch

A highly efficient implementation of Gaussian Processes in PyTorch
MIT License
3.59k stars 562 forks source link

Gaussian Regression with Measurement Uncertainties #592

Closed hsilver closed 5 years ago

hsilver commented 5 years ago

I have a vector X of input variables, and a vector Y of observations, with a vector SD of standard deviations. For the moment we can assume that the uncertainties on the observations Y are Gaussian. The standard deviations are different for each Y value. I want to perform Gaussian Process regression on this data set. How should I do this in gpytorch?

This seems like a very basic question but I've spent the afternoon digging through the GPyTorch documentation, and just found myself going around in circles with nothing working. In SciKit-Learn it can be done out-of-the-box like so: gp = GaussianProcessRegressor(kernel=kernel, alpha = SD**2, n_restarts_optimizer=10)

jacobrgardner commented 5 years ago

@hsilver Currently, the WhiteNoiseKernel will let you add a diagonal component to the train-train covariance matrix, e.g.:

self.covar_module = ScaleKernel(RBFKernel()) + WhiteNoiseKernel(SD**2)

The plan for 0.3.0 (ETA early April) is to move this functionality to a new likelihood rather than a kernel, because the noise model of a GP really is the likelihood more than a kernel choice. However for the moment the above should work.

hsilver commented 5 years ago

Fantastic, thanks!