Adding "double-prior" in GP

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,

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.

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

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

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

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

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