I apologize in advance for the vagueness, but I can't think of a more descriptive title. I am trying to find the average value of the square of BesselJ[0, x] evaluated over many lists. The function I am using is
f[h_, n_, m_] := Mean[BesselJ[0, h Table[Accumulate[Table[RandomChoice[{-1., 1.}], {j, n}]], {k, m}]]^2];
I am looking for ways to speed up this function for large values of n and m. Compiling doesn't help here since BesselJ is not compilable.