Adding "double-prior" in GP


#1

Hi all,

I’ve been trying to place a kind of “double-layer” priors on GP models. It is clear in the tutorial about how to set the prior distribution on lengthscale parameters (i.e. by calling model.kernle.set_prior(‘lengthscale’, dist.LogNormal(mean, variance)))

The problem I have is to place another distribution on the “LogNormal” dist. In mathematics,

sigma_i~N(1.,1.)
l_i~LogNormal(1., sigma_i)

where l_i represents the length scale parameter.

I see a somehow related post adding GP in mixed effects models. But I am not sure whether it is valid to change the kernel every time for updating.

Could anyone tell me or give me some hints about this? I really appreciate all your help and time.


#2

@uempheral I would suggest to build a GP model from scratch if you want to set hierarchical priors for hyperparameters. :slight_smile:


#3

Okay!Thank you so much for your reply. I will try to build the model from scratch :grin:


#4

Hi @uempheral, I just think about this again and change my mind. Actually you can do something like this

def model():
     sigma_i~N(1.,1.)
     l_i~LogNormal(1., sigma_i)
     kernel.lengthscale = l_i
     ...

#5

Thank you so much! (Sorry that I did not notice you replied to me.)