-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Combining Gaussian process with mixed effects #234
Description
Hello,
I was wondering if it's possible to maybe implement custom mean functions in a GPR model? The use case I have is to fit a model of the following type:
Y_{c,t} = alpha + alpha_c + beta * X_{c,t} + (Time GP_t)
alpha_c ~ Normal(0., sigma_a)
GP_t ~ Matern52(., .)
Therefore, the mean function I'd like to feed into the GP would be alpha + alpha_c + beta*X, where alpha_c is a random effect on the c dimension, and the GP is on the t dimension.
The reason why I'd like to fit a model like this is to be able to model a mixed effects regression with GP errors. Using Edward2 from TFP, I can do something like tf.gather(parameter_vector, vector_of_indices_indicating_different_c), which will do like a matrix multiplication of the index and the associated parameter we're fitting on the random effect. I believe I can follow through on the various mixed effect models examples you guys have, so the last piece that I'd need to implement there would be to add a GP in the model.
Two things I can think of two implement this would be:
- Building a GPR where the mean function will have all the traditional random effects and multiple fixed effects as needed.
- Using the linear mixed effects model example, where I build in a GP component in the model.
I think the second would be preferable just because it'd give us more flexibility overall I think. Ideally, if there's a way to add a Gaussian process term in the model here, then that'd be the best: https://github.com/tensorflow/probability/blob/master/tensorflow_probability/examples/jupyter_notebooks/Linear_Mixed_Effects_Models.ipynb
Any tips would be great! Thanks!