Redundant computations with multilevel models and Slice sampler

Following up on the above, I’ve now tested Metropolis and Slice on the old implementation where each likelihood node is exposed to pymc. Again we’re measuring parameter cache hits. It actually looks quite similar. Example graphical model now:


Aside from the model internals seen in the model graph, everything else should be identical. (Still 100 draws, 1 chain.)

M=1:
Slice: [200]
Metropolis: [200]

M=2:
Slice: [877, 912]
Metropolis: [400, 400]

M=4:
Slice: [2455, 2418, 2413, 2364]
Metropolis: [800, 800, 800, 800]

M=8:
Slice: [5381, 5324, 5275, 5283, 5283, 5303, 5301, 5302]
Metropolis: [1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600]

If it’d help, I could code up a MWE with a simple toy model. The drift diffusion model code I have is currently a bit of a sprawling WIP so it may not be the most productive to try and work with them for this.