Summation notation

I have the current setup for calculating Allan Deviation:

which was coded as:

Sqrt[Total[Differences[y]^2]/(2 (M - 1))]


However, after doing some research, overlapping Allan Deviation is what I need to calculate, which looks like:

For the life of me, I can't figure out how to adjust my code for this change... I attempted to put it in as you see above (in fact, this was done with the math palette), but it runs for a long time, then when I graph the results with ListLogLogPlot it gives an empty graph. I am guessing Mathematica doesn't understand the subscript is being used as an index. I searched the Summation documentation, however, it doesn't discuss how to enter the portions of a function.

Here is a copy of the code (which I am sure some of you will recognize, as I asked last week about some of the nuances of working with this function in Mathematica, mapping, tables, etc).

WN = WhiteNoiseProcess[NormalDistribution[0, 10]];
Module[{data, points, yBinLst, y, M},
data = RandomFunction[WN, {1, 10000}];
points = data["Values"];
yBinLst = Partition[points, m];
y = Mean /@ yBinLst;
M = Length[yBinLst];

Sqrt[Total[Differences[y]^2]/(2 (M - 1))]
]
SeedRandom[0];
mValues = Range[2, 5000, 1];

• Have you tried using Indexed or Part rather than the subscripts in your Sum? May 27, 2015 at 20:34
• Including code (no matter how messy) for your second image would be nice so we don't have to reenter it manually. May 27, 2015 at 20:36
• Sqrt[(\!$$\*UnderoverscriptBox[\(\[Sum]$$, $$j = 1$$, $$(M - 2 m + 1)$$]$$\*UnderoverscriptBox[\(\[Sum]$$, $$i = j$$, $$(j + m - 1)$$] \*SuperscriptBox[$$( \*SubscriptBox[\(y$$, $$i + m$$] - \*SubscriptBox[$$y$$, $$i$$])\), $$2$$]\)\))/2 m^2 (M - 2 m + 1)] Like this? Also, sorry about that. :/ May 27, 2015 at 20:44
• Yes, that can be pasted into Mathematica and it saves work retyping. May 27, 2015 at 20:45
• There may be faster ways to perform the computation if speed is a limiting factor. For example you could start from Differences[y, 1, m]^2. May 27, 2015 at 21:08

Maybe what you want?

aDev2[m_] :=
Module[{data, points, yBinLst, y, M},
data = RandomFunction[WN, {1, 10000}];
points = data["Values"];
yBinLst = Partition[points, m];
y = Mean /@ yBinLst;
M = Length[yBinLst];
Sum[(y[[i + m]] - y[[i]])^2, {j, 1, M - 2 m + 1}, {i, j, j + m - 1}]/
2 m^2 (M - 2 m + 1) // Sqrt
]

SeedRandom[0];
mValues = Range[2, 5000, 1];