0

Say I have a problem having D outputs with isotopic data, I would like to use independent noise for each output dimension of a multi-output GP model (Intrinsic Coregionalisation Model) in gpflow, which is the most general case like:

a busy cat

I have seen some example of using multi-output GPs in GPflow, like this notebook and this question

However, it seems for the GPR model class in gpflow, the likelihood variance ($\Sigma$) is still one number instead of D numbers even if a product kernel (i.e. Kernel * Coregionalization) is specified.

Is there any way to achieve that?

STJ
  • 1,478
  • 7
  • 25
Will
  • 101
  • 1
  • 11

1 Answers1

1

Just like you can augment X with a column that designates for each data point (row) which output it relates to (the column is specified by the active_dims keyword argument to the Coregion kernel; note that it is zero-based indexing), you can augment Y with a column to specify different likelihoods (the SwitchedLikelihood is hard-coded to require the index to be in the last column of Y) - there is an example (Demo 2) in the varying noise notebook in the GPflow tutorials. You just have to combine the two, use a Coregion kernel and a SwitchedLikelihood, and augment both X and Y with the same column indicating outputs!

However, as plain GPR only works with a Gaussian likelihood, the GPR model has been hard-coded for a Gaussian likelihood. It would certainly be possible to write a version of it that can deal with different Gaussian likelihoods for the different outputs, but you would have to do it all manually in the _build_likelihood method of a new model (incorporating the stitching code from the SwitchedLikelihood).

It would be much easier to simply use a VGP model that can handle any likelihood - for Gaussian likelihoods the optimisation problem is very simple and should be easy to optimise using ScipyOptimizer.

STJ
  • 1,478
  • 7
  • 25
  • Thanks, I'm just wondering why use VGP in the notebook, as I am trying to use the standard GPR in gpflow, however when I manually specify the GPR's likelihood attribute from Gaussian() to SwitchedLikelihood, it told me 'SwitchedLikelihood' object has no attribute 'variance' when I call compute_log_likelihood() for testing – Will Aug 22 '19 at 12:54
  • @Will plain GPR *only* works with a Gaussian likelihood, and the `GPR` model is hard-coded for a Gaussian likelihood - you could certainly rewrite it to work with different Gaussian likelihoods for the different outputs, but you would have to do it all manually in the `_build_likelihood` method. – STJ Aug 22 '19 at 14:29