How best to use a posterior sample as a prior for a future integration in another model?

Hi @jessegrabowski,
thanks for the links. Have I understood the histogram_approximation method right that you could do something like:

import pymc as pm
import pymc_experimental as pmx
import pytensor.tensor as pt
import arviz

with modelA:
    a = pm.Normal('a')
    b = pm.Normal('b')
    obs = pm.Normal('obs', a + b, obs_error, observed=obs_mean)
    traceA = pm.sample()

postA = arviz.extract(traceA.posterior)
postA_ab = np.stack([postA["a"], postA["b"]])

with modelB:
    a = pm.Uniform('a', -1000, 1000)  # ignorant priors
    b = pm.Uniform('b', -1000, 1000)  
    c = pt.concatenate([a, b])  # 2-dimensional random variable
    pot = pmx.distributions.histogram_approximation(
        "pot_model_A", c, observed=postA_ab.T) 
    
    new_obs = pm.Normal('new_obs', a + b, new_obs_error, observed=new_obs_mean)
    traceB = pm.sample()

And that would be equivalent to:

with modelAB:
    a = pm.Normal('a')
    b = pm.Normal('b')
    obs = pm.Normal('obs', a + b, obs_error, observed=obs_mean)
    new_obs = pm.Normal('new_obs', a + b, new_obs_error, observed=new_obs_mean)
    traceAB = pm.sample()

?