RockSample lower bound optimization

Currently an inner loop updates the average for each rock for each particle.
Convert this to an average for each rock for each state and get some speedup.