Implement, for a window k, arrays of the same length as the input with NaN for the first k - 1 positions:
k
NaN
k - 1
sma(x, k)
wma(x, k)
1, 2, ..., k