Note that for n = odd, can average at central period. If n = even, must average at end of period and then shift values
mov.avg(x, k = 10, shift = "centre")
A vector to calculate moving average
The moving windows
if shift = "centre", then values are shifted to centre. if shift = "begin", then values are at begin of period. if shift = "end", then values are at end of period. The default value (centre) will be used if shift is other value.
The moving average of vector x at moving windows n