Today I learned that prod()
function in JAGS is not
as fast as I expected. It runs out in a analysis that
took ~70 seconds, an additional 10 seconds was added for
each use of prod()
. May not make a hill of beans in a
small analysis that is done in less than 2 minutes, but
I am needing analyses that scale. Any performance
improvement is important! So by
spelling out the multiplication inline as
1-(p[i,1,1,1]*p[i,2,1,1]*p[i,3,1,1]*p[i,4,1,1]*p[i,5,1,1])
versus
1-(prod(p[i,1:5,1,1])
was a good performance boost, enough to move forward with for future analyses.