SheffieldML / GPy

Gaussian processes framework in python
BSD 3-Clause "New" or "Revised" License
2.04k stars 562 forks source link

Different Poisson likelihood #515

Open Riksi opened 7 years ago

Riksi commented 7 years ago

This is not exactly an issue but a question about usage. Sorry if this not the right place for it - I did email the mailing list gpy-users@lists.shef.ac.uk about a month back and received no response so thought I would try posting here.

I am trying to implement a model with Gaussian Process prior and Poisson likelihood. However the Poisson parameter is not exp(f) but exp(f)*n where n is a known value associated with the output y.

Specifically in the model y is a count at certain location and point in time whilst n is a fixed value representing the expected count at that location. (I am trying to implement the model described in this paper https://www.ml.cmu.edu/research/dap-papers/dap_flaxman.pdf, page 11)

It does not seem to be possible to implement this using the existing Poisson likelihood in GPy. I would like to know if it is possible for me to implement a custom likelihood. In the likelihood classes the functions have a parameter Y_metadata and this is also a parameter in functions in classes in GPy.core. What exactly does this represent? Can this be used for n in my likelihood? Or does it represent something different?

If anything above is not clear, I will be happy to clarify further.

lawrennd commented 7 years ago

Hi Riksi, @alansaul might be able to help. One thin we're thinking of doing is moving discussion like this over to stack exchange, just out of info, does that sounds sensible?

On Tue, Jun 27, 2017 at 7:54 AM Riksi notifications@github.com wrote:

This is not exactly an issue but a question about usage. Sorry if this not the right place for it - I did email the mailing list gpy-users@lists.shef.ac.uk about a month back and received no response so thought I would try posting here.

I am trying to implement a model with Gaussian Process prior and Poisson likelihood. However the Poisson parameter is not exp(f) but exp(f)*n where n is a known value associated with the output y.

Specifically in the model y is a count at certain location and point in time whilst n is a fixed value representing the expected count at that location. (I am trying to implement the model described in this paper https://www.ml.cmu.edu/research/dap-papers/dap_flaxman.pdf, page 11)

It does not seem to be possible to implement this using the existing Poisson likelihood in GPy. I would like to know if it is possible for me to implement a custom likelihood. In the likelihood classes the functions have a parameter Y_metadata and this is also a parameter in functions in classes in GPy.core. What exactly does this represent? Can this be used for n in my likelihood? Or does it represent something different?

If anything above is not clear. I will be happy to clarify further.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SheffieldML/GPy/issues/515, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIKWgUHLVwSNq-7Dv3qggzjXiA5_J9Lks5sIKc1gaJpZM4OGNvS .

avehtari commented 7 years ago

I can confirm that the model Riksi would like to use is quite common one and it would be useful to allow the optional argument (although with some different notation than n).

Riksi, if you are in a hurry, and don't want to modify the current likelihood function (which would be quite easy although making it carefully takes some time anyway), you could use exp(f+g), where g=log(n), and you can you can use basis function kernel to form a g with observation specific values. It's not exactly what you want, but close.