Am 11.09.2019 um 19:57 schrieb Artur Tarassow:
Am 11.09.19 um 19:48 schrieb Sven Schreiber:
> To me the question is how
> actually a centered MA is calculated for an even number of terms -
> shouldn't it be the center plus the same "tails" left and right such
> that overall it will be an odd number p?
This was exactly the question I originally had in mind.
Apart from the answer "Use the source, Luke!" here is some evidence:
<hansl>
nulldata 3
series x = 0
x[2] = 2
x[3] = 1
eval (0 + 2 + 1) / 3 # 1
eval 0.25 * 0 + 0.5 * 2 + 0.25 * 1 # 1.25
eval movavg(x, 2, 1) # NA,1.25,NA
</hansl>
So I guess an appropriately weighted average is used.
cheers
sven