Reparameterization ("Matt trick") failing to produce a speed improvement in hierarchical model

A couple of things:

  1. The speed report from sampling is one shot, and pretty noisy, so it’s possible that the speed change isn’t that much. Check out this post if you want more precise measures.
  2. You can vectorize the assignment in the transformed parameter block which may help.
  3. The speed improvement from the transformed parameter should be measured in terms of effective samples per second, not in terms of the time it takes to evaluate a single leapfrog step. If your steps are slower, but results in an increased step size and fewer leapfrog steps, you’ll still be coming out ahead.
2 Likes