Skip to content

Use the `PriorSet` from the first step of PE as the `sampling_prior` for hyper-pe

It would be really nice to be able to use the PriorSet object from the first step of PE as the sampling_prior in the hyper-parameter likelihood. This way you don't have to rewrite the prior as a function in order to pass it to the hyper-parameter likelihood, and it keeps the format consistent within tupak. I thought I could hack this simply by adding

if not (isinstance(sampling_prior, Model) or isinstance(sampling_prior, PriorSet)):
              sampling_prior = Model([sampling_prior])

in the __init__ of the HyperParameterLikelihood but actually the prob() method of the of the PriorSet class can't handle the data structure used in the HyperParameterLikelihood. Do other people think this would be worthwhile @colm.talbot @gregory.ashton? I'd imagine that if people are using tupak for hyper-pe, they've used it for the first step as well, and it would be very convenient to just recycle the prior.

Edited by Sylvia Biscoveanu