Hi,
I have two different models trained on two different datasets.
I need to build a third model which combines parts of the two models There is no observed data/Likelihood, just some pm.Deterministic which are based on distributions of the two initial models.
Here is a stripped down example
with pm.Model() as model1:
mu1 = pm.Normal('mu1', mu=1, sd=1)
like1 = pm.Normal('like1', mu=mu1, sd=1.0, observed=data1)
model1_advi = pm.ADVI()
model1_approx = model1_advi.fit()
with pm.Model() as model2:
mu2 = pm.Normal('mu2', mu=1, sd=1)
like2 = pm.Normal('like2', mu=mu2, sd=1.0, observed=data2)
model2_advi = pm.ADVI()
model2_approx = model2_advi.fit()
with pm.Model() as model3:
interested_in = pm.Deterministic('interested_in', some_function(mu1, mu2))
I have some questions about this approach.
- How can I get the values of interested_in?
- If I fit model3, are the log likelihoods combined into a single one? Or are they treated independently? I would also need to give model3 as model parameter to model1 and model2.
- Is there a way to sample from the deterministic interested_in without fitting?
Thank you!